Dynomotion

Group: DynoMotion Message: 1303 From: jonny1bar Date: 6/19/2011
Subject: Newbe needs help
Hi All,

Im new to the Kflop board just got it out today for play.
I have managed to install the software and wire up a stepper motor.
I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
I loaded the Kmotioncnc and tried to jog but nothing.

Thanks

John
Group: DynoMotion Message: 1304 From: Tom Kerekes Date: 6/19/2011
Subject: Re: Newbe needs help
Hi John,
 
After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion Program is no longer needed to configure and enable your axes.
 
Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,A  need to be mapped to specific KFLOP axis channel numbers using a C Language function call such as DefineCoordSystem(0,1,2,-1);
For a general description of the various ways parameters in KFLOP can be configured see:
 
 
For help on converting your parameter setting automatically to C code see step :
 
 
HTH
TK
 
 
 
 


--- On Sun, 6/19/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Sunday, June 19, 2011, 9:46 AM

 
Hi All,

Im new to the Kflop board just got it out today for play.
I have managed to install the software and wire up a stepper motor.
I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
I loaded the Kmotioncnc and tried to jog but nothing.

Thanks

John

Group: DynoMotion Message: 1305 From: jonny1bar Date: 6/19/2011
Subject: Re: Newbe needs help
Hi TK,

Thanks for thr quick reply,
I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
Thanks for your quick response.

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion Program is no longer needed to configure and enable your axes.
>  
> Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,A  need to be mapped to specific KFLOP axis channel numbers using a C Language function call such as DefineCoordSystem(0,1,2,-1);
>
> For a general description of the various ways parameters in KFLOP can be configured see:
>  
> http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
>  
> For help on converting your parameter setting automatically to C code see step :
>  
> http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
>  
> HTH
> TK
>  
>  
>  
>  
>
>
> --- On Sun, 6/19/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Sunday, June 19, 2011, 9:46 AM
>
>
>  
>
>
>
> Hi All,
>
> Im new to the Kflop board just got it out today for play.
> I have managed to install the software and wire up a stepper motor.
> I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> I loaded the Kmotioncnc and tried to jog but nothing.
>
> Thanks
>
> John
>
Group: DynoMotion Message: 1306 From: Tom Kerekes Date: 6/19/2011
Subject: Re: Newbe needs help
Hi John,
 
Did you read the links I sent?  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.  The button doesn't do anything directly.  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.  You might tell a bit about your background so we know where to start.
 
If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
 
From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
 
Regards
TK


--- On Sun, 6/19/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Sunday, June 19, 2011, 11:50 AM

 
Hi TK,

Thanks for thr quick reply,
I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
Thanks for your quick response.

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion Program is no longer needed to configure and enable your axes.
>  
> Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,A  need to be mapped to specific KFLOP axis channel numbers using a C Language function call such as DefineCoordSystem(0,1,2,-1);
>
> For a general description of the various ways parameters in KFLOP can be configured see:
>  
> http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
>  
> For help on converting your parameter setting automatically to C code see step :
>  
> http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
>  
> HTH
> TK
>  
>  
>  
>  
>
>
> --- On Sun, 6/19/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Sunday, June 19, 2011, 9:46 AM
>
>
>  
>
>
>
> Hi All,
>
> Im new to the Kflop board just got it out today for play.
> I have managed to install the software and wire up a stepper motor.
> I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> I loaded the Kmotioncnc and tried to jog but nothing.
>
> Thanks
>
> John
>

Group: DynoMotion Message: 1307 From: jonny1bar Date: 6/20/2011
Subject: Re: Newbe needs help
Hi TK,

I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
Next question is the limit switches.
First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
My home switches are 3 wire proximity switches +5v, gnd & signal.
I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
I own a small modelmakeing and prototyping company in Bristol UK.
Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable

Thanks for your help we are getting there.

John


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> Did you read the links I sent?  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.  The button doesn't do anything directly.  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.  You might tell a bit about your background so we know where to start.
>  
> If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
>  
> From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
>  
> Regards
> TK
>
>
> --- On Sun, 6/19/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Sunday, June 19, 2011, 11:50 AM
>
>
>  
>
>
>
> Hi TK,
>
> Thanks for thr quick reply,
> I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> Thanks for your quick response.
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion Program is no longer needed to configure and enable your axes.
> >  
> > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,A  need to be mapped to specific KFLOP axis channel numbers using a C Language function call such as DefineCoordSystem(0,1,2,-1);
> >
> > For a general description of the various ways parameters in KFLOP can be configured see:
> >  
> > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> >  
> > For help on converting your parameter setting automatically to C code see step :
> >  
> > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> >  
> > HTH
> > TK
> >  
> >  
> >  
> >  
> >
> >
> > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Sunday, June 19, 2011, 9:46 AM
> >
> >
> >  
> >
> >
> >
> > Hi All,
> >
> > Im new to the Kflop board just got it out today for play.
> > I have managed to install the software and wire up a stepper motor.
> > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > I loaded the Kmotioncnc and tried to jog but nothing.
> >
> > Thanks
> >
> > John
> >
>
Group: DynoMotion Message: 1308 From: Tom Kerekes Date: 6/20/2011
Subject: Re: Newbe needs help
Hi John,
 
That's good progress.
 
Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
 
You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.  That keeps your specific files separate and makes it easier to upgrade to new versions.
 
The indicated Home Inputs are just recommendations.  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.  Or put a 100 ohm resistor in series.
 
There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.  Maybe you have one already?  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
 
Regards
TK
 


--- On Mon, 6/20/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Monday, June 20, 2011, 4:08 AM

 
Hi TK,

I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
Next question is the limit switches.
First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
My home switches are 3 wire proximity switches +5v, gnd & signal.
I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
I own a small modelmakeing and prototyping company in Bristol UK.
Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable

Thanks for your help we are getting there.

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> Did you read the links I sent?  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.  The button doesn't do anything directly.  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.  You might tell a bit about your background so we know where to start.
>  
> If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
>  
> From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
>  
> Regards
> TK
>
>
> --- On Sun, 6/19/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Sunday, June 19, 2011, 11:50 AM
>
>
>  
>
>
>
> Hi TK,
>
> Thanks for thr quick reply,
> I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> Thanks for your quick response.
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion Program is no longer needed to configure and enable your axes.
> >  
> > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,A  need to be mapped to specific KFLOP axis channel numbers using a C Language function call such as DefineCoordSystem(0,1,2,-1);
> >
> > For a general description of the various ways parameters in KFLOP can be configured see:
> >  
> > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> >  
> > For help on converting your parameter setting automatically to C code see step :
> >  
> > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> >  
> > HTH
> > TK
> >  
> >  
> >  
> >  
> >
> >
> > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Sunday, June 19, 2011, 9:46 AM
> >
> >
> >  
> >
> >
> >
> > Hi All,
> >
> > Im new to the Kflop board just got it out today for play.
> > I have managed to install the software and wire up a stepper motor.
> > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > I loaded the Kmotioncnc and tried to jog but nothing.
> >
> > Thanks
> >
> > John
> >
>

Group: DynoMotion Message: 1309 From: jonny1bar Date: 6/20/2011
Subject: Re: Newbe needs help
Hi TK
I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
What is the max I can run?(I'm a speed demon)
Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
Thanks again

John


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
>
>
>
>
>
> Hi John,
>  
> That's good progress.
>  
> Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
>  
> You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.  That keeps your specific files separate and makes it easier to upgrade to new versions.
>  
> The indicated Home Inputs are just recommendations.  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.  Or put a 100 ohm resistor in series.
>  
> There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.  Maybe you have one already?  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
>  
> Regards
> TK
>  
>
>
> --- On Mon, 6/20/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Monday, June 20, 2011, 4:08 AM
>
>
>  
>
>
>
> Hi TK,
>
> I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> Next question is the limit switches.
> First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> My home switches are 3 wire proximity switches +5v, gnd & signal.
> I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> I own a small modelmakeing and prototyping company in Bristol UK.
> Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
>
> Thanks for your help we are getting there.
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > Did you read the links I sent?  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.  The button doesn't do anything directly.  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.  You might tell a bit about your background so we know where to start.
> >  
> > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> >  
> > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> >  
> > Regards
> > TK
> >
> >
> > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Sunday, June 19, 2011, 11:50 AM
> >
> >
> >  
> >
> >
> >
> > Hi TK,
> >
> > Thanks for thr quick reply,
> > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > Thanks for your quick response.
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion Program is no longer needed to configure and enable your axes.
> > >  
> > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,A  need to be mapped to specific KFLOP axis channel numbers using a C Language function call such as DefineCoordSystem(0,1,2,-1);
> > >
> > > For a general description of the various ways parameters in KFLOP can be configured see:
> > >  
> > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > >  
> > > For help on converting your parameter setting automatically to C code see step :
> > >  
> > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > >  
> > > HTH
> > > TK
> > >  
> > >  
> > >  
> > >  
> > >
> > >
> > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Sunday, June 19, 2011, 9:46 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi All,
> > >
> > > Im new to the Kflop board just got it out today for play.
> > > I have managed to install the software and wire up a stepper motor.
> > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > I loaded the Kmotioncnc and tried to jog but nothing.
> > >
> > > Thanks
> > >
> > > John
> > >
> >
>
Group: DynoMotion Message: 1310 From: Tom Kerekes Date: 6/20/2011
Subject: Re: Newbe needs help
Hi John,
 
Let's see:  at 160 steps/mm x 10000mm/min x  1mm / 60sec = 26,666 steps/sec
KFLOP can pulse at 2.5MHz so that won't be your limitation.
 
I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.  Most Stepper motors have very limited torque beyond that step rate. 
All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3. 
 
The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.  Then test if the input toggles properly using the Digital I/O Screen.  If so, then configure the Limit Settings on the Config/Flash Screen.  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.  Use the "Disallow drive into limit" mode.  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
 
No sorry SnapAmp doesn't have any 0-10V analog outputs.  But yes it can drive steppers, brushless, or brush motors.
 
Regards
TK
 

--- On Mon, 6/20/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Monday, June 20, 2011, 2:13 PM

 
Hi TK
I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
What is the max I can run?(I'm a speed demon)
Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
Thanks again

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
>
>
>
>
>
> Hi John,
>  
> That's good progress.
>  
> Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
>  
> You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.  That keeps your specific files separate and makes it easier to upgrade to new versions.
>  
> The indicated Home Inputs are just recommendations.  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.  Or put a 100 ohm resistor in series.
>  
> There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.  Maybe you have one already?  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
>  
> Regards
> TK
>  
>
>
> --- On Mon, 6/20/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Monday, June 20, 2011, 4:08 AM
>
>
>  
>
>
>
> Hi TK,
>
> I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> Next question is the limit switches.
> First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> My home switches are 3 wire proximity switches +5v, gnd & signal.
> I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> I own a small modelmakeing and prototyping company in Bristol UK.
> Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
>
> Thanks for your help we are getting there.
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > Did you read the links I sent?  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.  The button doesn't do anything directly.  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.  You might tell a bit about your background so we know where to start.
> >  
> > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> >  
> > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> >  
> > Regards
> > TK
> >
> >
> > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Sunday, June 19, 2011, 11:50 AM
> >
> >
> >  
> >
> >
> >
> > Hi TK,
> >
> > Thanks for thr quick reply,
> > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > Thanks for your quick response.
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion Program is no longer needed to configure and enable your axes.
> > >  
> > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,A  need to be mapped to specific KFLOP axis channel numbers using a C Language function call such as DefineCoordSystem(0,1,2,-1);
> > >
> > > For a general description of the various ways parameters in KFLOP can be configured see:
> > >  
> > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > >  
> > > For help on converting your parameter setting automatically to C code see step :
> > >  
> > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > >  
> > > HTH
> > > TK
> > >  
> > >  
> > >  
> > >  
> > >
> > >
> > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Sunday, June 19, 2011, 9:46 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi All,
> > >
> > > Im new to the Kflop board just got it out today for play.
> > > I have managed to install the software and wire up a stepper motor.
> > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > I loaded the Kmotioncnc and tried to jog but nothing.
> > >
> > > Thanks
> > >
> > > John
> > >
> >
>

Group: DynoMotion Message: 1325 From: jonny1bar Date: 6/22/2011
Subject: Re: Newbe needs help
Hi Tom,

I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
When you jog the axis and then press the limit switch the axis stops as it should.
Can you help me with motor step response settings I havent got a clue what i am doing.

Can you also have a quick look at axis C code

#include "KMotionDef.h"

// Defines axis 0, 1, 2 as simple step dir outputs
// enables them
// sets them as an xyz coordinate system for GCode

int main()
{
ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=40000;
ch0->Accel=400000;
ch0->Jerk=4000000;
ch0->P=0;
ch0->I=0.009999999776483;
ch0->D=0;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=200;
ch0->MaxErr=1000000;
ch0->MaxOutput=200;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=2;
ch0->InputChan1=0;
ch0->OutputChan0=2;
ch0->OutputChan1=0;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x0;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=1000000000;
ch0->StepperAmplitude=20;

ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=0.0007689999765716;
ch0->iir[2].B1=0.001537999953143;
ch0->iir[2].B2=0.0007689999765716;
ch0->iir[2].A1=1.920809984207;
ch0->iir[2].A2=-0.9238849878311;
EnableAxisDest(0,0);

ch1->InputMode=NO_INPUT_MODE;
ch1->OutputMode=STEP_DIR_MODE;
ch1->Vel=40000;
ch1->Accel=400000;
ch1->Jerk=4000000;
ch1->P=0;
ch1->I=0.009999999776483;
ch1->D=0;
ch1->FFAccel=0;
ch1->FFVel=0;
ch1->MaxI=200;
ch1->MaxErr=1000000;
ch1->MaxOutput=200;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=2;
ch1->InputChan1=0;
ch1->OutputChan0=2;
ch1->OutputChan1=0;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x0;
ch1->InputGain0=1;
ch1->InputGain1=1;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=1000000000;
ch1->StepperAmplitude=20;

ch1->iir[0].B0=1;
ch1->iir[0].B1=0;
ch1->iir[0].B2=0;
ch1->iir[0].A1=0;
ch1->iir[0].A2=0;

ch1->iir[1].B0=1;
ch1->iir[1].B1=0;
ch1->iir[1].B2=0;
ch1->iir[1].A1=0;
ch1->iir[1].A2=0;

ch1->iir[2].B0=0.0007689999765716;
ch1->iir[2].B1=0.001537999953143;
ch1->iir[2].B2=0.0007689999765716;
ch1->iir[2].A1=1.920809984207;
ch1->iir[2].A2=-0.9238849878311;
EnableAxisDest(1,0);

ch2->InputMode=NO_INPUT_MODE;
ch2->OutputMode=STEP_DIR_MODE;
ch2->Vel=40000;
ch2->Accel=400000;
ch2->Jerk=4000000;
ch2->P=0;
ch2->I=0.009999999776483;
ch2->D=0;
ch2->FFAccel=0;
ch2->FFVel=0;
ch2->MaxI=200;
ch2->MaxErr=1000000;
ch2->MaxOutput=200;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=0;
ch2->InputChan1=0;
ch2->OutputChan0=0;
ch2->OutputChan1=0;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x30015;
ch2->InputGain0=1;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=1;
ch2->Lead=0;
ch2->MaxFollowingError=1000000000;
ch2->StepperAmplitude=20;

ch2->iir[0].B0=1;
ch2->iir[0].B1=0;
ch2->iir[0].B2=0;
ch2->iir[0].A1=0;
ch2->iir[0].A2=0;

ch2->iir[1].B0=1;
ch2->iir[1].B1=0;
ch2->iir[1].B2=0;
ch2->iir[1].A1=0;
ch2->iir[1].A2=0;

ch2->iir[2].B0=0.0007689999765716;
ch2->iir[2].B1=0.001537999953143;
ch2->iir[2].B2=0.0007689999765716;
ch2->iir[2].A1=1.920809984207;
ch2->iir[2].A2=-0.9238849878311;
EnableAxisDest(2,0);

DefineCoordSystem(0,1,2,-1);

return 0;
}

And this is the one for the home switches.

#include "KMotionDef.h"

// Configuration and Homing program for a 3 axis System
// Limit switches are disabled and used as a home switch
// then they are re-enabled


main()
{
int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings

DisableAxis(0); // Disable all axes
DisableAxis(1);
DisableAxis(2);

// Set the axis parameters here
// after everything is configured in the KMotion Screens
// use copy C Code to clipboard on the configuration screen
// then paste here. Repeat for each axis

ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=40000;
ch0->Accel=400000;
ch0->Jerk=4000000;
ch0->P=0;
ch0->I=0.009999999776483;
ch0->D=0;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=200;
ch0->MaxErr=1000000;
ch0->MaxOutput=200;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=2;
ch0->InputChan1=0;
ch0->OutputChan0=2;
ch0->OutputChan1=0;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x0;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=1000000000;
ch0->StepperAmplitude=20;

ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=0.0007689999765716;
ch0->iir[2].B1=0.001537999953143;
ch0->iir[2].B2=0.0007689999765716;
ch0->iir[2].A1=1.920809984207;
ch0->iir[2].A2=-0.9238849878311;

ch1->InputMode=NO_INPUT_MODE;
ch1->OutputMode=STEP_DIR_MODE;
ch1->Vel=40000;
ch1->Accel=400000;
ch1->Jerk=4000000;
ch1->P=0;
ch1->I=0.009999999776483;
ch1->D=0;
ch1->FFAccel=0;
ch1->FFVel=0;
ch1->MaxI=200;
ch1->MaxErr=1000000;
ch1->MaxOutput=200;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=2;
ch1->InputChan1=0;
ch1->OutputChan0=2;
ch1->OutputChan1=0;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x0;
ch1->InputGain0=1;
ch1->InputGain1=1;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=1000000000;
ch1->StepperAmplitude=20;

ch1->iir[0].B0=1;
ch1->iir[0].B1=0;
ch1->iir[0].B2=0;
ch1->iir[0].A1=0;
ch1->iir[0].A2=0;

ch1->iir[1].B0=1;
ch1->iir[1].B1=0;
ch1->iir[1].B2=0;
ch1->iir[1].A1=0;
ch1->iir[1].A2=0;

ch1->iir[2].B0=0.0007689999765716;
ch1->iir[2].B1=0.001537999953143;
ch1->iir[2].B2=0.0007689999765716;
ch1->iir[2].A1=1.920809984207;
ch1->iir[2].A2=-0.9238849878311;

ch2->InputMode=NO_INPUT_MODE;
ch2->OutputMode=STEP_DIR_MODE;
ch2->Vel=40000;
ch2->Accel=400000;
ch2->Jerk=4000000;
ch2->P=0;
ch2->I=0.009999999776483;
ch2->D=0;
ch2->FFAccel=0;
ch2->FFVel=0;
ch2->MaxI=200;
ch2->MaxErr=1000000;
ch2->MaxOutput=200;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=0;
ch2->InputChan1=0;
ch2->OutputChan0=0;
ch2->OutputChan1=0;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x30015;
ch2->InputGain0=1;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=1;
ch2->Lead=0;
ch2->MaxFollowingError=1000000000;
ch2->StepperAmplitude=20;

ch2->iir[0].B0=1;
ch2->iir[0].B1=0;
ch2->iir[0].B2=0;
ch2->iir[0].A1=0;
ch2->iir[0].A2=0;

ch2->iir[1].B0=1;
ch2->iir[1].B1=0;
ch2->iir[1].B2=0;
ch2->iir[1].A1=0;
ch2->iir[1].A2=0;

ch2->iir[2].B0=0.0007689999765716;
ch2->iir[2].B1=0.001537999953143;
ch2->iir[2].B2=0.0007689999765716;
ch2->iir[2].A1=1.920809984207;
ch2->iir[2].A2=-0.9238849878311;






// disable the limits (first save how they were set)
SaveXLimits = ch0->LimitSwitchOptions;
SaveYLimits = ch1->LimitSwitchOptions;
SaveZLimits = ch2->LimitSwitchOptions;
ch0->LimitSwitchOptions = 0;
ch1->LimitSwitchOptions = 0;
ch2->LimitSwitchOptions = 0;

// enable all 3 axes and begin servoing where we are

EnableAxis(0);
EnableAxis(1);
EnableAxis(2);


// Home Z up first - jog until it sees the limit

Jog(2,100); // jog slowly positive
while (!ReadBit(10)) ; // loop until IO bit goes high
Jog(2,0); // stop
while (!CheckDone(2)) ; // loop until motion completes
DisableAxis(2); // disable the axis
Zero(2); // Zero the position
EnableAxis(2); // re-enable the ServoTick
Move(2,-1000.0); // move some amount inside the limits
while (!CheckDone(2)) ; // loop until motion completes
ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings


// Home X next - jog until it sees the limit

Jog(0,-100); // jog slowly negative
while (!ReadBit(10)) ; // loop until IO bit goes high
Jog(0,0); // stop
while (!CheckDone(0)) ; // loop until motion completes
DisableAxis(0); // disable the axis
Zero(0); // Zero the position
EnableAxis(0); // re-enable the ServoTick
Move(0,1000.0); // move some amount inside the limits
while (!CheckDone(0)) ; // loop until motion completes
ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings


// Home Y next - jog until it sees the limit

Jog(1,-100); // jog slowly negative
while (!ReadBit(9)) ; // loop until IO bit goes high
Jog(1,0); // stop
while (!CheckDone(1)) ; // loop until motion completes
DisableAxis(1); // disable the axis
Zero(1); // Zero the position
EnableAxis(1); // re-enable the ServoTick
Move(1,1000.0); // move some amount inside the limits
while (!CheckDone(1)) ; // loop until motion completes
ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings

DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
}


Thanks for all your help

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> Let's see:  at 160 steps/mm x 10000mm/min x  1mm / 60sec = 26,666 steps/sec
> KFLOP can pulse at 2.5MHz so that won't be your limitation.
>  
> I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.  Most Stepper motors have very limited torque beyond that step rate. 
>
> All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3. 
>  
> The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.  Then test if the input toggles properly using the Digital I/O Screen.  If so, then configure the Limit Settings on the Config/Flash Screen.  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.  Use the "Disallow drive into limit" mode.  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
>  
> No sorry SnapAmp doesn't have any 0-10V analog outputs.  But yes it can drive steppers, brushless, or brush motors.
>  
> Regards
> TK
>  
>
> --- On Mon, 6/20/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Monday, June 20, 2011, 2:13 PM
>
>
>  
>
>
>
> Hi TK
> I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> What is the max I can run?(I'm a speed demon)
> Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> Thanks again
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> >
> >
> >
> >
> >
> > Hi John,
> >  
> > That's good progress.
> >  
> > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> >  
> > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.  That keeps your specific files separate and makes it easier to upgrade to new versions.
> >  
> > The indicated Home Inputs are just recommendations.  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.  Or put a 100 ohm resistor in series.
> >  
> > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.  Maybe you have one already?  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> >  
> > Regards
> > TK
> >  
> >
> >
> > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Monday, June 20, 2011, 4:08 AM
> >
> >
> >  
> >
> >
> >
> > Hi TK,
> >
> > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > Next question is the limit switches.
> > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > I own a small modelmakeing and prototyping company in Bristol UK.
> > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> >
> > Thanks for your help we are getting there.
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > Did you read the links I sent?  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.  The button doesn't do anything directly.  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.  You might tell a bit about your background so we know where to start.
> > >  
> > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > >  
> > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > >  
> > > Regards
> > > TK
> > >
> > >
> > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Sunday, June 19, 2011, 11:50 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi TK,
> > >
> > > Thanks for thr quick reply,
> > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > Thanks for your quick response.
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > > ÃÆ'‚ 
> > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > ÃÆ'‚ 
> > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'‚ function callÃÆ'‚ such asÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > >
> > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > ÃÆ'‚ 
> > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > ÃÆ'‚ 
> > > > For help on converting your parameter setting automatically to C code see step :
> > > > ÃÆ'‚ 
> > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > ÃÆ'‚ 
> > > > HTH
> > > > TK
> > > > ÃÆ'‚ 
> > > > ÃÆ'‚ 
> > > > ÃÆ'‚ 
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > >
> > > > Hi All,
> > > >
> > > > Im new to the Kflop board just got it out today for play.
> > > > I have managed to install the software and wire up a stepper motor.
> > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > >
> > > > Thanks
> > > >
> > > > John
> > > >
> > >
> >
>
Group: DynoMotion Message: 1345 From: jonny1bar Date: 6/23/2011
Subject: Re: Newbe needs help
Hi Tom,

Did you get a chance to look at my code?

Thanks

John

--- In DynoMotion@yahoogroups.com, "jonny1bar" <john@...> wrote:
>
> Hi All,
>
> Im new to the Kflop board just got it out today for play.
> I have managed to install the software and wire up a stepper motor.
> I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> I loaded the Kmotioncnc and tried to jog but nothing.
>
> Thanks
>
> John
>
Group: DynoMotion Message: 1347 From: Tom Kerekes Date: 6/23/2011
Subject: Re: Newbe needs help
Hi John,
 
The code looks reasonable to me.  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
 
For Mach3 each axis is homed separately.  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
 
But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
 
To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.  Which is the Jog, wait for switch, stop.  See if that works.
 
Regards,
TK


--- On Wed, 6/22/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Wednesday, June 22, 2011, 11:05 AM

 
Hi Tom,

I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
When you jog the axis and then press the limit switch the axis stops as it should.
Can you help me with motor step response settings I havent got a clue what i am doing.

Can you also have a quick look at axis C code

#include "KMotionDef.h"

// Defines axis 0, 1, 2 as simple step dir outputs
// enables them
// sets them as an xyz coordinate system for GCode

int main()
{
ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=40000;
ch0->Accel=400000;
ch0->Jerk=4000000;
ch0->P=0;
ch0->I=0.009999999776483;
ch0->D=0;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=200;
ch0->MaxErr=1000000;
ch0->MaxOutput=200;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=2;
ch0->InputChan1=0;
ch0->OutputChan0=2;
ch0->OutputChan1=0;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x0;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=1000000000;
ch0->StepperAmplitude=20;

ch0->iir[0] .B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=0.0007689999765716;
ch0->iir[2].B1=0.001537999953143;
ch0->iir[2].B2=0.0007689999765716;
ch0->iir[2].A1=1.920809984207;
ch0->iir[2].A2=-0.9238849878311;
EnableAxisDest(0,0);

ch1->InputMode=NO_INPUT_MODE;
ch1->OutputMode=STEP_DIR_MODE;
ch1->Vel=40000;
ch1->Accel=400000;
ch1->Jerk=4000000;
ch1->P=0;
ch1->I=0.009999999776483;
ch1->D=0;
ch1->FFAccel=0;
ch1->FFVel=0;
ch1->MaxI=200;
ch1->MaxErr=1000000;
ch1->MaxOutput=200;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=2;
ch1->InputChan1=0;
ch1->OutputChan0=2;
ch1->OutputChan1=0;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x0;
ch1->InputGain0=1;
ch1->InputGain1=1;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=1000000000;
ch1->StepperAmplitude=20;

ch1->iir[0].B0=1;
ch1->iir[0].B1=0;
ch1->iir[0].B2=0;
ch1->iir[0].A1=0;
ch1->iir[0].A2=0;

ch1->iir[1].B0=1;
ch1->iir[1].B1=0;
ch1->iir[1].B2=0;
ch1->iir[1].A1=0;
ch1->iir[1].A2=0;

ch1->iir[2].B0=0.0007689999765716;
ch1->iir[2].B1=0.001537999953143;
ch1->iir[2].B2=0.0007689999765716;
ch1->iir[2].A1=1.920809984207;
ch1->iir[2].A2=-0.9238849878311;
EnableAxisDest(1,0);

ch2->InputMode=NO_INPUT_MODE;
ch2->OutputMode=ST EP_DIR_MODE;
ch2->Vel=40000;
ch2->Accel=400000;
ch2->Jerk=4000000;
ch2->P=0;
ch2->I=0.009999999776483;
ch2->D=0;
ch2->FFAccel=0;
ch2->FFVel=0;
ch2->MaxI=200;
ch2->MaxErr=1000000;
ch2->MaxOutput=200;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=0;
ch2->InputChan1=0;
ch2->OutputChan0=0;
ch2->OutputChan1=0;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x30015;
ch2->InputGain0=1;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=1;
ch2->Lead=0;
ch2->MaxFollowingError=1000000000;
ch2->StepperAmplitude=20;

ch2->iir[0].B0=1;
ch2->iir[0].B1=0;
ch2->iir[0].B2=0;
ch2-& gt;iir[0].A1=0;
ch2->iir[0].A2=0;

ch2->iir[1].B0=1;
ch2->iir[1].B1=0;
ch2->iir[1].B2=0;
ch2->iir[1].A1=0;
ch2->iir[1].A2=0;

ch2->iir[2].B0=0.0007689999765716;
ch2->iir[2].B1=0.001537999953143;
ch2->iir[2].B2=0.0007689999765716;
ch2->iir[2].A1=1.920809984207;
ch2->iir[2].A2=-0.9238849878311;
EnableAxisDest(2,0);

DefineCoordSystem(0,1,2,-1);

return 0;
}

And this is the one for the home switches.

#include "KMotionDef.h"

// Configuration and Homing program for a 3 axis System
// Limit switches are disabled and used as a home switch
// then they are re-enabled

main()
{
int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings

DisableAxis(0); // Disable all axes
DisableAxis(1);
DisableAxis(2);

// Set the axis parameters here
// after everything is configured in the KMotion Screens
// use copy C Code to clipboard on the configuration screen
// then paste here. Repeat for each axis

ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=40000;
ch0->Accel=400000;
ch0->Jerk=4000000;
ch0->P=0;
ch0->I=0.009999999776483;
ch0->D=0;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=200;
ch0->MaxErr=1000000;
ch0->MaxOutput=200;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=2;
ch0->InputChan1=0;
ch0->OutputChan0=2;
ch0->OutputChan1=0;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x0;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=1000000000;
ch0->StepperAmplitude=20;

ch0->iir [0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=0.0007689999765716;
ch0->iir[2].B1=0.001537999953143;
ch0->iir[2].B2=0.0007689999765716;
ch0->iir[2].A1=1.920809984207;
ch0->iir[2].A2=-0.9238849878311;

ch1->InputMode=NO_INPUT_MODE;
ch1->OutputMode=STEP_DIR_MODE;
ch1->Vel=40000;
ch1->Accel=400000;
ch1->Jerk=4000000;
ch1->P=0;
ch1->I=0.009999999776483;
ch1->D=0;
ch1->FFAccel=0;
ch1->FFVel=0;
ch1->MaxI=200;
ch1->MaxErr=1000000;
ch1->MaxOutput=200;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=2;
ch1->InputChan1=0;
ch1->OutputChan0=2;
ch1->OutputChan1=0;
ch1->MasterAxis=-1;
ch1->LimitSwitchO ptions=0x0;
ch1->InputGain0=1;
ch1->InputGain1=1;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=1000000000;
ch1->StepperAmplitude=20;

ch1->iir[0].B0=1;
ch1->iir[0].B1=0;
ch1->iir[0].B2=0;
ch1->iir[0].A1=0;
ch1->iir[0].A2=0;

ch1->iir[1].B0=1;
ch1->iir[1].B1=0;
ch1->iir[1].B2=0;
ch1->iir[1].A1=0;
ch1->iir[1].A2=0;

ch1->iir[2].B0=0.0007689999765716;
ch1->iir[2].B1=0.001537999953143;
ch1->iir[2].B2=0.0007689999765716;
ch1->iir[2].A1=1.920809984207;
ch1->iir[2].A2=-0.9238849878311;

ch2->InputMode=NO_INPUT_MODE;
ch2->OutputMode=STEP_DIR_MODE;
ch2->Vel=40000;
ch2-> ;Accel=400000;
ch2->Jerk=4000000;
ch2->P=0;
ch2->I=0.009999999776483;
ch2->D=0;
ch2->FFAccel=0;
ch2->FFVel=0;
ch2->MaxI=200;
ch2->MaxErr=1000000;
ch2->MaxOutput=200;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=0;
ch2->InputChan1=0;
ch2->OutputChan0=0;
ch2->OutputChan1=0;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x30015;
ch2->InputGain0=1;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=1;
ch2->Lead=0;
ch2->MaxFollowingError=1000000000;
ch2->StepperAmplitude=20;

ch2->iir[0].B0=1;
ch2->iir[0].B1=0;
ch2->iir[0].B2=0;
ch2->iir[0].A1=0;
ch2->iir[0].A2=0;
ch2->iir[1].B0=1;
ch2->iir[1].B1=0;
ch2->iir[1].B2=0;
ch2->iir[1].A1=0;
ch2->iir[1].A2=0;

ch2->iir[2].B0=0.0007689999765716;
ch2->iir[2].B1=0.001537999953143;
ch2->iir[2].B2=0.0007689999765716;
ch2->iir[2].A1=1.920809984207;
ch2->iir[2].A2=-0.9238849878311;





// disable the limits (first save how they were set)
SaveXLimits = ch0->LimitSwitchOptions;
SaveYLimits = ch1->LimitSwitchOptions;
SaveZLimits = ch2->LimitSwitchOptions;
ch0->LimitSwitchOptions = 0;
ch1->LimitSwitchOptions = 0;
ch2->LimitSwitchOptions = 0;

// enable all 3 axes and begin servoing where we are

EnableAxis(0);
EnableAxis(1);
EnableAxis(2);

// Home Z up first - jog until it sees the limit

Jog(2,100); // jog slowly positive
while (!ReadBit(10)) ; // loop until IO bit goes high
Jog(2,0); // stop
while (!CheckDone(2)) ; // loop until motion completes
DisableAxis(2); // disable the axis
Zero(2); // Zero the position
EnableAxis(2); // re-enable the ServoTick
Move(2,-1000.0); // move some amount inside the limits
while (!CheckDone(2)) ; // loop until motion completes
ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings

// Home X next - jog until it sees the limit

Jog(0,-100); // jog slowly negative
while (!ReadBit(10)) ; // loop until IO bit goes high
Jog(0,0); // stop
while (!CheckDone(0)) ; // loop until motion completes
DisableAxis(0); // disable the axis
Zero(0); // Zero the position
EnableAxis(0); // re-enable the ServoTick
Move(0,1000.0); // move some amount inside the limits
while (!CheckDone(0)) ; // loop until motion completes
ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings

// Home Y next - jog until it sees the limit

Jog(1,-100); // jog slowly negative
while (!ReadBit(9)) ; // loop until IO bit goes high
Jog(1,0); // stop
while (!CheckDone(1)) ; // loop until motion completes
DisableAxis(1); // disable the axis
Zero(1); // Zero the position
EnableAxis(1); // re-enable the ServoTick
Move(1,1000.0); // move some amount inside the limits
while (!CheckDone(1)) ; // loop until motion completes
ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings

DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
}

Thanks for all your help

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> Let's see:  at 160 steps/mm x 10000mm/min x  1mm / 60sec = 26,666 steps/sec
> KFLOP can pulse at 2.5MHz so that won't be your limitation.
>  
> I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.  Most Stepper motors have very limited torque beyond that step rate. 
>
> All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3. 
>  
> The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.  Then test if the input toggles properly using the Digital I/O Screen.  If so, then configure the Limit Settings on the Config/Flash Screen.  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.  Use the "Disallow drive into limit" mode.  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
>  
> No sorry SnapAmp doesn't have any 0-10V analog outputs.  But yes it can drive steppers, brushless, or brush motors.
>  
> Regards
> TK
>  
>
> --- On Mon, 6/20/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Monday, June 20, 2011, 2:13 PM
>
>
>  
>
>
>
> Hi TK
> I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> What is the max I can run?(I'm a speed demon)
> Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> Thanks again
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> >
> >
> >
> >
> >
> > Hi John,
> >  
> > That's good progress.
> >  
> > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> >  
> > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.  That keeps your specific files separate and makes it easier to upgrade to new versions.
> >  
> > The indicated Home Inputs are just recommendations.  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.  Or put a 100 ohm resistor in series.
> >  
> > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.  Maybe you have one already?  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> >  
> > Regards
> > TK
> >  
> >
> >
> > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Monday, June 20, 2011, 4:08 AM
> >
> >
> >  
> >
> >
> >
> > Hi TK,
> >
> > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > Next question is the limit switches.
> > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > I own a small modelmakeing and prototyping company in Bristol UK.
> > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> >
> > Thanks for your help we are getting there.
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > Did you read the links I sent?  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.  The button doesn't do anything directly.  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.  You might tell a bit about your background so we know where to start.
> > >  
> > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > >  
> > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > >  
> > > Regards
> > > TK
> > >
> > >
> > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Sunday, June 19, 2011, 11:50 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi TK,
> > >
> > > Thanks for thr quick reply,
> > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > Thanks for your quick response.
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > > ÃÆ'‚ 
> > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > ÃÆ'‚ 
> > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'‚ function callÃÆ'‚ such asÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > >
> > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > ÃÆ'‚ 
> > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > ÃÆ'‚ 
> > > > For help on converting your parameter setting automatically to C code see step :
> > > > ÃÆ'‚ 
> > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > ÃÆ'‚ 
> > > > HTH
> > > > TK
> > > > ÃÆ'‚ 
> > > > ÃÆ'‚ 
> > > > ÃÆ'‚ 
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > >
> > > > Hi All,
> > > >
> > > > Im new to the Kflop board just got it out today for play.
> > > > I have managed to install the software and wire up a stepper motor.
> > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > >
> > > > Thanks
> > > >
> > > > John
> > > >
> > >
> >
>

Group: DynoMotion Message: 1350 From: jonny1bar Date: 6/23/2011
Subject: Re: Newbe needs help
Hi Tom,

Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
If it works can i try it through mach3.
I have just worked out you can run the program from the c screen.
Were so close I can taste it.

Thanks

John

#include "KMotionDef.h"

// Configuration and Homing program for a 3 axis System
// Limit switches are disabled and used as a home switch
// then they are re-enabled


main()
{


// enable all 3 axes and begin servoing where we are

EnableAxis(0);
EnableAxis(1);
EnableAxis(2);


// Home Z up first - jog until it sees the limit

Jog(2,100); // jog slowly positive
while (!ReadBit(10)) ; // loop until IO bit goes high
Jog(2,0); // stop
while (!CheckDone(2)) ; // loop until motion completes
DisableAxis(2); // disable the axis
Zero(2); // Zero the position
EnableAxis(2); // re-enable the ServoTick
Move(2,-1000.0); // move some amount inside the limits
while (!CheckDone(2)) ; // loop until motion completes
ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings


// Home X next - jog until it sees the limit

Jog(0,-100); // jog slowly negative
while (!ReadBit(10)) ; // loop until IO bit goes high
Jog(0,0); // stop
while (!CheckDone(0)) ; // loop until motion completes
DisableAxis(0); // disable the axis
Zero(0); // Zero the position
EnableAxis(0); // re-enable the ServoTick
Move(0,1000.0); // move some amount inside the limits
while (!CheckDone(0)) ; // loop until motion completes
ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings


// Home Y next - jog until it sees the limit

Jog(1,-100); // jog slowly negative
while (!ReadBit(9)) ; // loop until IO bit goes high
Jog(1,0); // stop
while (!CheckDone(1)) ; // loop until motion completes
DisableAxis(1); // disable the axis
Zero(1); // Zero the position
EnableAxis(1); // re-enable the ServoTick
Move(1,1000.0); // move some amount inside the limits
while (!CheckDone(1)) ; // loop until motion completes
ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings

DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
}


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> The code looks reasonable to me.  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
>  
> For Mach3 each axis is homed separately.  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
>  
> But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
>  
> To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.  Which is the Jog, wait for switch, stop.  See if that works.
>  
> Regards,
> TK
>
>
> --- On Wed, 6/22/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Wednesday, June 22, 2011, 11:05 AM
>
>
>  
>
>
>
> Hi Tom,
>
> I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> When you jog the axis and then press the limit switch the axis stops as it should.
> Can you help me with motor step response settings I havent got a clue what i am doing.
>
> Can you also have a quick look at axis C code
>
> #include "KMotionDef.h"
>
> // Defines axis 0, 1, 2 as simple step dir outputs
> // enables them
> // sets them as an xyz coordinate system for GCode
>
> int main()
> {
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=STEP_DIR_MODE;
> ch0->Vel=40000;
> ch0->Accel=400000;
> ch0->Jerk=4000000;
> ch0->P=0;
> ch0->I=0.009999999776483;
> ch0->D=0;
> ch0->FFAccel=0;
> ch0->FFVel=0;
> ch0->MaxI=200;
> ch0->MaxErr=1000000;
> ch0->MaxOutput=200;
> ch0->DeadBandGain=1;
> ch0->DeadBandRange=0;
> ch0->InputChan0=2;
> ch0->InputChan1=0;
> ch0->OutputChan0=2;
> ch0->OutputChan1=0;
> ch0->MasterAxis=-1;
> ch0->LimitSwitchOptions=0x0;
> ch0->InputGain0=1;
> ch0->InputGain1=1;
> ch0->InputOffset0=0;
> ch0->InputOffset1=0;
> ch0->OutputGain=1;
> ch0->OutputOffset=0;
> ch0->SlaveGain=1;
> ch0->BacklashMode=BACKLASH_OFF;
> ch0->BacklashAmount=0;
> ch0->BacklashRate=0;
> ch0->invDistPerCycle=1;
> ch0->Lead=0;
> ch0->MaxFollowingError=1000000000;
> ch0->StepperAmplitude=20;
>
> ch0->iir[0].B0=1;
> ch0->iir[0].B1=0;
> ch0->iir[0].B2=0;
> ch0->iir[0].A1=0;
> ch0->iir[0].A2=0;
>
> ch0->iir[1].B0=1;
> ch0->iir[1].B1=0;
> ch0->iir[1].B2=0;
> ch0->iir[1].A1=0;
> ch0->iir[1].A2=0;
>
> ch0->iir[2].B0=0.0007689999765716;
> ch0->iir[2].B1=0.001537999953143;
> ch0->iir[2].B2=0.0007689999765716;
> ch0->iir[2].A1=1.920809984207;
> ch0->iir[2].A2=-0.9238849878311;
> EnableAxisDest(0,0);
>
> ch1->InputMode=NO_INPUT_MODE;
> ch1->OutputMode=STEP_DIR_MODE;
> ch1->Vel=40000;
> ch1->Accel=400000;
> ch1->Jerk=4000000;
> ch1->P=0;
> ch1->I=0.009999999776483;
> ch1->D=0;
> ch1->FFAccel=0;
> ch1->FFVel=0;
> ch1->MaxI=200;
> ch1->MaxErr=1000000;
> ch1->MaxOutput=200;
> ch1->DeadBandGain=1;
> ch1->DeadBandRange=0;
> ch1->InputChan0=2;
> ch1->InputChan1=0;
> ch1->OutputChan0=2;
> ch1->OutputChan1=0;
> ch1->MasterAxis=-1;
> ch1->LimitSwitchOptions=0x0;
> ch1->InputGain0=1;
> ch1->InputGain1=1;
> ch1->InputOffset0=0;
> ch1->InputOffset1=0;
> ch1->OutputGain=1;
> ch1->OutputOffset=0;
> ch1->SlaveGain=1;
> ch1->BacklashMode=BACKLASH_OFF;
> ch1->BacklashAmount=0;
> ch1->BacklashRate=0;
> ch1->invDistPerCycle=1;
> ch1->Lead=0;
> ch1->MaxFollowingError=1000000000;
> ch1->StepperAmplitude=20;
>
> ch1->iir[0].B0=1;
> ch1->iir[0].B1=0;
> ch1->iir[0].B2=0;
> ch1->iir[0].A1=0;
> ch1->iir[0].A2=0;
>
> ch1->iir[1].B0=1;
> ch1->iir[1].B1=0;
> ch1->iir[1].B2=0;
> ch1->iir[1].A1=0;
> ch1->iir[1].A2=0;
>
> ch1->iir[2].B0=0.0007689999765716;
> ch1->iir[2].B1=0.001537999953143;
> ch1->iir[2].B2=0.0007689999765716;
> ch1->iir[2].A1=1.920809984207;
> ch1->iir[2].A2=-0.9238849878311;
> EnableAxisDest(1,0);
>
> ch2->InputMode=NO_INPUT_MODE;
> ch2->OutputMode=STEP_DIR_MODE;
> ch2->Vel=40000;
> ch2->Accel=400000;
> ch2->Jerk=4000000;
> ch2->P=0;
> ch2->I=0.009999999776483;
> ch2->D=0;
> ch2->FFAccel=0;
> ch2->FFVel=0;
> ch2->MaxI=200;
> ch2->MaxErr=1000000;
> ch2->MaxOutput=200;
> ch2->DeadBandGain=1;
> ch2->DeadBandRange=0;
> ch2->InputChan0=0;
> ch2->InputChan1=0;
> ch2->OutputChan0=0;
> ch2->OutputChan1=0;
> ch2->MasterAxis=-1;
> ch2->LimitSwitchOptions=0x30015;
> ch2->InputGain0=1;
> ch2->InputGain1=1;
> ch2->InputOffset0=0;
> ch2->InputOffset1=0;
> ch2->OutputGain=1;
> ch2->OutputOffset=0;
> ch2->SlaveGain=1;
> ch2->BacklashMode=BACKLASH_OFF;
> ch2->BacklashAmount=0;
> ch2->BacklashRate=0;
> ch2->invDistPerCycle=1;
> ch2->Lead=0;
> ch2->MaxFollowingError=1000000000;
> ch2->StepperAmplitude=20;
>
> ch2->iir[0].B0=1;
> ch2->iir[0].B1=0;
> ch2->iir[0].B2=0;
> ch2->iir[0].A1=0;
> ch2->iir[0].A2=0;
>
> ch2->iir[1].B0=1;
> ch2->iir[1].B1=0;
> ch2->iir[1].B2=0;
> ch2->iir[1].A1=0;
> ch2->iir[1].A2=0;
>
> ch2->iir[2].B0=0.0007689999765716;
> ch2->iir[2].B1=0.001537999953143;
> ch2->iir[2].B2=0.0007689999765716;
> ch2->iir[2].A1=1.920809984207;
> ch2->iir[2].A2=-0.9238849878311;
> EnableAxisDest(2,0);
>
> DefineCoordSystem(0,1,2,-1);
>
> return 0;
> }
>
> And this is the one for the home switches.
>
> #include "KMotionDef.h"
>
> // Configuration and Homing program for a 3 axis System
> // Limit switches are disabled and used as a home switch
> // then they are re-enabled
>
> main()
> {
> int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
>
> DisableAxis(0); // Disable all axes
> DisableAxis(1);
> DisableAxis(2);
>
> // Set the axis parameters here
> // after everything is configured in the KMotion Screens
> // use copy C Code to clipboard on the configuration screen
> // then paste here. Repeat for each axis
>
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=STEP_DIR_MODE;
> ch0->Vel=40000;
> ch0->Accel=400000;
> ch0->Jerk=4000000;
> ch0->P=0;
> ch0->I=0.009999999776483;
> ch0->D=0;
> ch0->FFAccel=0;
> ch0->FFVel=0;
> ch0->MaxI=200;
> ch0->MaxErr=1000000;
> ch0->MaxOutput=200;
> ch0->DeadBandGain=1;
> ch0->DeadBandRange=0;
> ch0->InputChan0=2;
> ch0->InputChan1=0;
> ch0->OutputChan0=2;
> ch0->OutputChan1=0;
> ch0->MasterAxis=-1;
> ch0->LimitSwitchOptions=0x0;
> ch0->InputGain0=1;
> ch0->InputGain1=1;
> ch0->InputOffset0=0;
> ch0->InputOffset1=0;
> ch0->OutputGain=1;
> ch0->OutputOffset=0;
> ch0->SlaveGain=1;
> ch0->BacklashMode=BACKLASH_OFF;
> ch0->BacklashAmount=0;
> ch0->BacklashRate=0;
> ch0->invDistPerCycle=1;
> ch0->Lead=0;
> ch0->MaxFollowingError=1000000000;
> ch0->StepperAmplitude=20;
>
> ch0->iir[0].B0=1;
> ch0->iir[0].B1=0;
> ch0->iir[0].B2=0;
> ch0->iir[0].A1=0;
> ch0->iir[0].A2=0;
>
> ch0->iir[1].B0=1;
> ch0->iir[1].B1=0;
> ch0->iir[1].B2=0;
> ch0->iir[1].A1=0;
> ch0->iir[1].A2=0;
>
> ch0->iir[2].B0=0.0007689999765716;
> ch0->iir[2].B1=0.001537999953143;
> ch0->iir[2].B2=0.0007689999765716;
> ch0->iir[2].A1=1.920809984207;
> ch0->iir[2].A2=-0.9238849878311;
>
> ch1->InputMode=NO_INPUT_MODE;
> ch1->OutputMode=STEP_DIR_MODE;
> ch1->Vel=40000;
> ch1->Accel=400000;
> ch1->Jerk=4000000;
> ch1->P=0;
> ch1->I=0.009999999776483;
> ch1->D=0;
> ch1->FFAccel=0;
> ch1->FFVel=0;
> ch1->MaxI=200;
> ch1->MaxErr=1000000;
> ch1->MaxOutput=200;
> ch1->DeadBandGain=1;
> ch1->DeadBandRange=0;
> ch1->InputChan0=2;
> ch1->InputChan1=0;
> ch1->OutputChan0=2;
> ch1->OutputChan1=0;
> ch1->MasterAxis=-1;
> ch1->LimitSwitchOptions=0x0;
> ch1->InputGain0=1;
> ch1->InputGain1=1;
> ch1->InputOffset0=0;
> ch1->InputOffset1=0;
> ch1->OutputGain=1;
> ch1->OutputOffset=0;
> ch1->SlaveGain=1;
> ch1->BacklashMode=BACKLASH_OFF;
> ch1->BacklashAmount=0;
> ch1->BacklashRate=0;
> ch1->invDistPerCycle=1;
> ch1->Lead=0;
> ch1->MaxFollowingError=1000000000;
> ch1->StepperAmplitude=20;
>
> ch1->iir[0].B0=1;
> ch1->iir[0].B1=0;
> ch1->iir[0].B2=0;
> ch1->iir[0].A1=0;
> ch1->iir[0].A2=0;
>
> ch1->iir[1].B0=1;
> ch1->iir[1].B1=0;
> ch1->iir[1].B2=0;
> ch1->iir[1].A1=0;
> ch1->iir[1].A2=0;
>
> ch1->iir[2].B0=0.0007689999765716;
> ch1->iir[2].B1=0.001537999953143;
> ch1->iir[2].B2=0.0007689999765716;
> ch1->iir[2].A1=1.920809984207;
> ch1->iir[2].A2=-0.9238849878311;
>
> ch2->InputMode=NO_INPUT_MODE;
> ch2->OutputMode=STEP_DIR_MODE;
> ch2->Vel=40000;
> ch2->Accel=400000;
> ch2->Jerk=4000000;
> ch2->P=0;
> ch2->I=0.009999999776483;
> ch2->D=0;
> ch2->FFAccel=0;
> ch2->FFVel=0;
> ch2->MaxI=200;
> ch2->MaxErr=1000000;
> ch2->MaxOutput=200;
> ch2->DeadBandGain=1;
> ch2->DeadBandRange=0;
> ch2->InputChan0=0;
> ch2->InputChan1=0;
> ch2->OutputChan0=0;
> ch2->OutputChan1=0;
> ch2->MasterAxis=-1;
> ch2->LimitSwitchOptions=0x30015;
> ch2->InputGain0=1;
> ch2->InputGain1=1;
> ch2->InputOffset0=0;
> ch2->InputOffset1=0;
> ch2->OutputGain=1;
> ch2->OutputOffset=0;
> ch2->SlaveGain=1;
> ch2->BacklashMode=BACKLASH_OFF;
> ch2->BacklashAmount=0;
> ch2->BacklashRate=0;
> ch2->invDistPerCycle=1;
> ch2->Lead=0;
> ch2->MaxFollowingError=1000000000;
> ch2->StepperAmplitude=20;
>
> ch2->iir[0].B0=1;
> ch2->iir[0].B1=0;
> ch2->iir[0].B2=0;
> ch2->iir[0].A1=0;
> ch2->iir[0].A2=0;
>
> ch2->iir[1].B0=1;
> ch2->iir[1].B1=0;
> ch2->iir[1].B2=0;
> ch2->iir[1].A1=0;
> ch2->iir[1].A2=0;
>
> ch2->iir[2].B0=0.0007689999765716;
> ch2->iir[2].B1=0.001537999953143;
> ch2->iir[2].B2=0.0007689999765716;
> ch2->iir[2].A1=1.920809984207;
> ch2->iir[2].A2=-0.9238849878311;
>
>
>
>
>
> // disable the limits (first save how they were set)
> SaveXLimits = ch0->LimitSwitchOptions;
> SaveYLimits = ch1->LimitSwitchOptions;
> SaveZLimits = ch2->LimitSwitchOptions;
> ch0->LimitSwitchOptions = 0;
> ch1->LimitSwitchOptions = 0;
> ch2->LimitSwitchOptions = 0;
>
> // enable all 3 axes and begin servoing where we are
>
> EnableAxis(0);
> EnableAxis(1);
> EnableAxis(2);
>
> // Home Z up first - jog until it sees the limit
>
> Jog(2,100); // jog slowly positive
> while (!ReadBit(10)) ; // loop until IO bit goes high
> Jog(2,0); // stop
> while (!CheckDone(2)) ; // loop until motion completes
> DisableAxis(2); // disable the axis
> Zero(2); // Zero the position
> EnableAxis(2); // re-enable the ServoTick
> Move(2,-1000.0); // move some amount inside the limits
> while (!CheckDone(2)) ; // loop until motion completes
> ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
>
> // Home X next - jog until it sees the limit
>
> Jog(0,-100); // jog slowly negative
> while (!ReadBit(10)) ; // loop until IO bit goes high
> Jog(0,0); // stop
> while (!CheckDone(0)) ; // loop until motion completes
> DisableAxis(0); // disable the axis
> Zero(0); // Zero the position
> EnableAxis(0); // re-enable the ServoTick
> Move(0,1000.0); // move some amount inside the limits
> while (!CheckDone(0)) ; // loop until motion completes
> ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
>
> // Home Y next - jog until it sees the limit
>
> Jog(1,-100); // jog slowly negative
> while (!ReadBit(9)) ; // loop until IO bit goes high
> Jog(1,0); // stop
> while (!CheckDone(1)) ; // loop until motion completes
> DisableAxis(1); // disable the axis
> Zero(1); // Zero the position
> EnableAxis(1); // re-enable the ServoTick
> Move(1,1000.0); // move some amount inside the limits
> while (!CheckDone(1)) ; // loop until motion completes
> ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
>
> DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> }
>
> Thanks for all your help
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > Let's see:  at 160 steps/mm x 10000mm/min x  1mm / 60sec = 26,666 steps/sec
> > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> >  
> > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.  Most Stepper motors have very limited torque beyond that step rate. 
> >
> > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3. 
> >  
> > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.  Then test if the input toggles properly using the Digital I/O Screen.  If so, then configure the Limit Settings on the Config/Flash Screen.  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.  Use the "Disallow drive into limit" mode.  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> >  
> > No sorry SnapAmp doesn't have any 0-10V analog outputs.  But yes it can drive steppers, brushless, or brush motors.
> >  
> > Regards
> > TK
> >  
> >
> > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Monday, June 20, 2011, 2:13 PM
> >
> >
> >  
> >
> >
> >
> > Hi TK
> > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > What is the max I can run?(I'm a speed demon)
> > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > Thanks again
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > Hi John,
> > >  
> > > That's good progress.
> > >  
> > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > >  
> > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > >  
> > > The indicated Home Inputs are just recommendations.  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.  Or put a 100 ohm resistor in series.
> > >  
> > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.  Maybe you have one already?  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > >
> > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Monday, June 20, 2011, 4:08 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi TK,
> > >
> > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > Next question is the limit switches.
> > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > >
> > > Thanks for your help we are getting there.
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > > ÃÆ'‚ 
> > > > Did you read the links I sent?ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'‚  The button doesn't do anything directly.ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > ÃÆ'‚ 
> > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > ÃÆ'‚ 
> > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > ÃÆ'‚ 
> > > > Regards
> > > > TK
> > > >
> > > >
> > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > >
> > > > Hi TK,
> > > >
> > > > Thanks for thr quick reply,
> > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > Thanks for your quick response.
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'Æ'‚ÃÆ'‚ function callÃÆ'Æ'‚ÃÆ'‚ such asÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > >
> > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > HTH
> > > > > TK
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > >
> > > > >
> > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > >
> > > > >
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi All,
> > > > >
> > > > > Im new to the Kflop board just got it out today for play.
> > > > > I have managed to install the software and wire up a stepper motor.
> > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > >
> > > > > Thanks
> > > > >
> > > > > John
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 1351 From: Tom Kerekes Date: 6/23/2011
Subject: Re: Newbe needs help
Hi John,
 
The error is because you have a line of code to restore the Limit Switch Options but you never saved the options and a location to save them was never declared. 
 
Are you using the same switch for homing and a limit?  If you are then you need to:
#1 declare a place to save the original settings
    Add an integer variable (inside the main function just after the bracket) with
 
    int SaveZLimits;
 
 
#2 save them before homing
 
   SaveZLimits = ch2->LimitSwitchOptions; // save original limit settings
#3 disable the limits
 
ch2->LimitSwitchOptions = 0;  // disable limits
 
 
#4 restore them (after homing)
 
ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
 
 
If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
 
 
Regards
TK
 


--- On Thu, 6/23/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Thursday, June 23, 2011, 10:43 AM

 
Hi Tom,

Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
If it works can i try it through mach3.
I have just worked out you can run the program from the c screen.
Were so close I can taste it.

Thanks

John

#include "KMotionDef.h"

// Configuration and Homing program for a 3 axis System
// Limit switches are disabled and used as a home switch
// then they are re-enabled

main()
{


// enable all 3 axes and begin servoing where we are

EnableAxis(0);
EnableAxis(1);
EnableAxis(2);

// Home Z up first - jog until it sees the limit

Jog(2,100); // jog slowly positive
while (!ReadBit(10)) ; // loop until IO bit goes high
Jog(2,0); // stop
while (!CheckDone(2)) ; // loop until motion completes
DisableAxis(2); // disable the axis
Zero(2); // Zero the position
EnableAxis(2); // re-enable the ServoTick
Move(2,-1000.0); // move some amount inside the limits
while (!CheckDone(2)) ; // loop until motion completes
ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings

// Home X next - jog until it sees the limit

Jog(0,-100); // jog slowly negative
while (!ReadBit(10)) ; // loop until IO bit goes high
Jog(0,0); // stop
while (!CheckDone(0)) ; // loop until motion completes
DisableAxis(0); // disable the axis
Zero(0); // Zero the position
EnableAxis(0); // re-enable the ServoTick
Move(0,1000.0); // move some amount inside the limits
while (!CheckDone(0)) ; // loop until motion completes
ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings

// Home Y next - jog until it sees the limit

Jog(1,-100); // jog slowly negative
while (!ReadBit(9)) ; // loop until IO bit goes high
Jog(1,0); // stop
while (!CheckDone(1)) ; // loop until motion completes
DisableAxis(1); // disable the axis
Zero(1); // Zero the position
EnableAxis(1); // re-enable the ServoTick
Move(1,1000.0); // move some amount inside the limits
while (!CheckDone(1)) ; // loop until motion completes
ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings

DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
}

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> The code looks reasonable to me.  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
>  
> For Mach3 each axis is homed separately.  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
>  
> But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
>  
> To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.  Which is the Jog, wait for switch, stop.  See if that works.
>  
> Regards,
> TK
>
>
> --- On Wed, 6/22/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Wednesday, June 22, 2011, 11:05 AM
>
>
>  
>
>
>
> Hi Tom,
>
> I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> When you jog the axis and then press the limit switch the axis stops as it should.
> Can you help me with motor step response settings I havent got a clue what i am doing.
>
> Can you also have a quick look at axis C code
>
> #include "KMotionDef.h"
>
> // Defines axis 0, 1, 2 as simple step dir outputs
> // enables them
> // sets them as an xyz coordinate system for GCode
>
> int main()
> {
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=STEP_DIR_MODE;
> ch0->Vel=40000;
> ch0->Accel=400000;
> ch0->Jerk=4000000;
> ch0->P=0;
> ch0->I=0.009999999776483;
> ch0->D=0;
> ch0->FFAccel=0;
> ch0->FFVel=0;
> ch0->MaxI=200;
> ch0->MaxErr=1000000;
> ch0->MaxOutput=200;
> ch0->DeadBandGain=1;
> ch0->DeadBandRange=0;
> ch0->InputChan0=2;
> ch0->InputChan1=0;
> ch0->OutputChan0=2;
> ch0->OutputChan1=0;
> ch0->MasterAxis=-1;
> ch0->LimitSwitchOptions=0x0;
> ch0->InputGain0=1;
> ch0->InputGain1=1;
> ch0->InputOffset0=0;
> ch0->InputOffset1=0;
> ch0->OutputGain=1;
> ch0->OutputOffset=0;
> ch0->SlaveGain=1;
> ch0->BacklashMode=BACKLASH_OFF;
> ch0->BacklashAmount=0;
> ch0->BacklashRate=0;
> ch0->invDistPerCycle=1;
> ch0->Lead=0;
> ch0->MaxFollowingError=1000000000;
> ch0->StepperAmplitude=20;
>
> ch0->iir[0].B0=1;
> ch0->iir[0].B1=0;
> ch0->iir[0].B2=0;
> ch0->iir[0].A1=0;
> ch0->iir[0].A2=0;
>
> ch0->iir[1].B0=1;
> ch0->iir[1].B1=0;
> ch0->iir[1].B2=0;
> ch0->iir[1].A1=0;
> ch0->iir[1].A2=0;
>
> ch0->iir[2].B0=0.0007689999765716;
> ch0->iir[2].B1=0.001537999953143;
> ch0->iir[2].B2=0.0007689999765716;
> ch0->iir[2].A1=1.920809984207;
> ch0->iir[2].A2=-0.9238849878311;
> EnableAxisDest(0,0);
>
> ch1->InputMode=NO_INPUT_MODE;
> ch1->OutputMode=STEP_DIR_MODE;
> ch1->Vel=40000;
> ch1->Accel=400000;
> ch1->Jerk=4000000;
> ch1->P=0;
> ch1->I=0.009999999776483;
> ch1->D=0;
> ch1->FFAccel=0;
> ch1->FFVel=0;
> ch1->MaxI=200;
> ch1->MaxErr=1000000;
> ch1->MaxOutput=200;
> ch1->DeadBandGain=1;
> ch1->DeadBandRange=0;
> ch1->InputChan0=2;
> ch1->InputChan1=0;
> ch1->OutputChan0=2;
> ch1->OutputChan1=0;
> ch1->MasterAxis=-1;
> ch1->LimitSwitchOptions=0x0;
> ch1->InputGain0=1;
> ch1->InputGain1=1;
> ch1->InputOffset0=0;
> ch1->InputOffset1=0;
> ch1->OutputGain=1;
> ch1->OutputOffset=0;
> ch1->SlaveGain=1;
> ch1->BacklashMode=BACKLASH_OFF;
> ch1->BacklashAmount=0;
> ch1->BacklashRate=0;
> ch1->invDistPerCycle=1;
> ch1->Lead=0;
> ch1->MaxFollowingError=1000000000;
> ch1->StepperAmplitude=20;
>
> ch1->iir[0].B0=1;
> ch1->iir[0].B1=0;
> ch1->iir[0].B2=0;
> ch1->iir[0].A1=0;
> ch1->iir[0].A2=0;
>
> ch1->iir[1].B0=1;
> ch1->iir[1].B1=0;
> ch1->iir[1].B2=0;
> ch1->iir[1].A1=0;
> ch1->iir[1].A2=0;
>
> ch1->iir[2].B0=0.0007689999765716;
> ch1->iir[2].B1=0.001537999953143;
> ch1->iir[2].B2=0.0007689999765716;
> ch1->iir[2].A1=1.920809984207;
> ch1->iir[2].A2=-0.9238849878311;
> EnableAxisDest(1,0);
>
> ch2->InputMode=NO_INPUT_MODE;
> ch2->OutputMode=STEP_DIR_MODE;
> ch2->Vel=40000;
> ch2->Accel=400000;
> ch2->Jerk=4000000;
> ch2->P=0;
> ch2->I=0.009999999776483;
> ch2->D=0;
> ch2->FFAccel=0;
> ch2->FFVel=0;
> ch2->MaxI=200;
> ch2->MaxErr=1000000;
> ch2->MaxOutput=200;
> ch2->DeadBandGain=1;
> ch2->DeadBandRange=0;
> ch2->InputChan0=0;
> ch2->InputChan1=0;
> ch2->OutputChan0=0;
> ch2->OutputChan1=0;
> ch2->MasterAxis=-1;
> ch2->LimitSwitchOptions=0x30015;
> ch2->InputGain0=1;
> ch2->InputGain1=1;
> ch2->InputOffset0=0;
> ch2->InputOffset1=0;
> ch2->OutputGain=1;
> ch2->OutputOffset=0;
> ch2->SlaveGain=1;
> ch2->BacklashMode=BACKLASH_OFF;
> ch2->BacklashAmount=0;
> ch2->BacklashRate=0;
> ch2->invDistPerCycle=1;
> ch2->Lead=0;
> ch2->MaxFollowingError=1000000000;
> ch2->StepperAmplitude=20;
>
> ch2->iir[0].B0=1;
> ch2->iir[0].B1=0;
> ch2->iir[0].B2=0;
> ch2->iir[0].A1=0;
> ch2->iir[0].A2=0;
>
> ch2->iir[1].B0=1;
> ch2->iir[1].B1=0;
> ch2->iir[1].B2=0;
> ch2->iir[1].A1=0;
> ch2->iir[1].A2=0;
>
> ch2->iir[2].B0=0.0007689999765716;
> ch2->iir[2].B1=0.001537999953143;
> ch2->iir[2].B2=0.0007689999765716;
> ch2->iir[2].A1=1.920809984207;
> ch2->iir[2].A2=-0.9238849878311;
> EnableAxisDest(2,0);
>
> DefineCoordSystem(0,1,2,-1);
>
> return 0;
> }
>
> And this is the one for the home switches.
>
> #include "KMotionDef.h"
>
> // Configuration and Homing program for a 3 axis System
> // Limit switches are disabled and used as a home switch
> // then they are re-enabled
>
> main()
> {
> int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
>
> DisableAxis(0); // Disable all axes
> DisableAxis(1);
> DisableAxis(2);
>
> // Set the axis parameters here
> // after everything is configured in the KMotion Screens
> // use copy C Code to clipboard on the configuration screen
> // then paste here. Repeat for each axis
>
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=STEP_DIR_MODE;
> ch0->Vel=40000;
> ch0->Accel=400000;
> ch0->Jerk=4000000;
> ch0->P=0;
> ch0->I=0.009999999776483;
> ch0->D=0;
> ch0->FFAccel=0;
> ch0->FFVel=0;
> ch0->MaxI=200;
> ch0->MaxErr=1000000;
> ch0->MaxOutput=200;
> ch0->DeadBandGain=1;
> ch0->DeadBandRange=0;
> ch0->InputChan0=2;
> ch0->InputChan1=0;
> ch0->OutputChan0=2;
> ch0->OutputChan1=0;
> ch0->MasterAxis=-1;
> ch0->LimitSwitchOptions=0x0;
> ch0->InputGain0=1;
> ch0->InputGain1=1;
> ch0->InputOffset0=0;
> ch0->InputOffset1=0;
> ch0->OutputGain=1;
> ch0->OutputOffset=0;
> ch0->SlaveGain=1;
> ch0->BacklashMode=BACKLASH_OFF;
> ch0->BacklashAmount=0;
> ch0->BacklashRate=0;
> ch0->invDistPerCycle=1;
> ch0->Lead=0;
> ch0->MaxFollowingError=1000000000;
> ch0->StepperAmplitude=20;
>
> ch0->iir[0].B0=1;
> ch0->iir[0].B1=0;
> ch0->iir[0].B2=0;
> ch0->iir[0].A1=0;
> ch0->iir[0].A2=0;
>
> ch0->iir[1].B0=1;
> ch0->iir[1].B1=0;
> ch0->iir[1].B2=0;
> ch0->iir[1].A1=0;
> ch0->iir[1].A2=0;
>
> ch0->iir[2].B0=0.0007689999765716;
> ch0->iir[2].B1=0.001537999953143;
> ch0->iir[2].B2=0.0007689999765716;
> ch0->iir[2].A1=1.920809984207;
> ch0->iir[2].A2=-0.9238849878311;
>
> ch1->InputMode=NO_INPUT_MODE;
> ch1->OutputMode=STEP_DIR_MODE;
> ch1->Vel=40000;
> ch1->Accel=400000;
> ch1->Jerk=4000000;
> ch1->P=0;
> ch1->I=0.009999999776483;
> ch1->D=0;
> ch1->FFAccel=0;
> ch1->FFVel=0;
> ch1->MaxI=200;
> ch1->MaxErr=1000000;
> ch1->MaxOutput=200;
> ch1->DeadBandGain=1;
> ch1->DeadBandRange=0;
> ch1->InputChan0=2;
> ch1->InputChan1=0;
> ch1->OutputChan0=2;
> ch1->OutputChan1=0;
> ch1->MasterAxis=-1;
> ch1->LimitSwitchOptions=0x0;
> ch1->InputGain0=1;
> ch1->InputGain1=1;
> ch1->InputOffset0=0;
> ch1->InputOffset1=0;
> ch1->OutputGain=1;
> ch1->OutputOffset=0;
> ch1->SlaveGain=1;
> ch1->BacklashMode=BACKLASH_OFF;
> ch1->BacklashAmount=0;
> ch1->BacklashRate=0;
> ch1->invDistPerCycle=1;
> ch1->Lead=0;
> ch1->MaxFollowingError=1000000000;
> ch1->StepperAmplitude=20;
>
> ch1->iir[0].B0=1;
> ch1->iir[0].B1=0;
> ch1->iir[0].B2=0;
> ch1->iir[0].A1=0;
> ch1->iir[0].A2=0;
>
> ch1->iir[1].B0=1;
> ch1->iir[1].B1=0;
> ch1->iir[1].B2=0;
> ch1->iir[1].A1=0;
> ch1->iir[1].A2=0;
>
> ch1->iir[2].B0=0.0007689999765716;
> ch1->iir[2].B1=0.001537999953143;
> ch1->iir[2].B2=0.0007689999765716;
> ch1->iir[2].A1=1.920809984207;
> ch1->iir[2].A2=-0.9238849878311;
>
> ch2->InputMode=NO_INPUT_MODE;
> ch2->OutputMode=STEP_DIR_MODE;
> ch2->Vel=40000;
> ch2->Accel=400000;
> ch2->Jerk=4000000;
> ch2->P=0;
> ch2->I=0.009999999776483;
> ch2->D=0;
> ch2->FFAccel=0;
> ch2->FFVel=0;
> ch2->MaxI=200;
> ch2->MaxErr=1000000;
> ch2->MaxOutput=200;
> ch2->DeadBandGain=1;
> ch2->DeadBandRange=0;
> ch2->InputChan0=0;
> ch2->InputChan1=0;
> ch2->OutputChan0=0;
> ch2->OutputChan1=0;
> ch2->MasterAxis=-1;
> ch2->LimitSwitchOptions=0x30015;
> ch2->InputGain0=1;
> ch2->InputGain1=1;
> ch2->InputOffset0=0;
> ch2->InputOffset1=0;
> ch2->OutputGain=1;
> ch2->OutputOffset=0;
> ch2->SlaveGain=1;
> ch2->BacklashMode=BACKLASH_OFF;
> ch2->BacklashAmount=0;
> ch2->BacklashRate=0;
> ch2->invDistPerCycle=1;
> ch2->Lead=0;
> ch2->MaxFollowingError=1000000000;
> ch2->StepperAmplitude=20;
>
> ch2->iir[0].B0=1;
> ch2->iir[0].B1=0;
> ch2->iir[0].B2=0;
> ch2->iir[0].A1=0;
> ch2->iir[0].A2=0;
>
> ch2->iir[1].B0=1;
> ch2->iir[1].B1=0;
> ch2->iir[1].B2=0;
> ch2->iir[1].A1=0;
> ch2->iir[1].A2=0;
>
> ch2->iir[2].B0=0.0007689999765716;
> ch2->iir[2].B1=0.001537999953143;
> ch2->iir[2].B2=0.0007689999765716;
> ch2->iir[2].A1=1.920809984207;
> ch2->iir[2].A2=-0.9238849878311;
>
>
>
>
>
> // disable the limits (first save how they were set)
> SaveXLimits = ch0->LimitSwitchOptions;
> SaveYLimits = ch1->LimitSwitchOptions;
> SaveZLimits = ch2->LimitSwitchOptions;
> ch0->LimitSwitchOptions = 0;
> ch1->LimitSwitchOptions = 0;
> ch2->LimitSwitchOptions = 0;
>
> // enable all 3 axes and begin servoing where we are
>
> EnableAxis(0);
> EnableAxis(1);
> EnableAxis(2);
>
> // Home Z up first - jog until it sees the limit
>
> Jog(2,100); // jog slowly positive
> while (!ReadBit(10)) ; // loop until IO bit goes high
> Jog(2,0); // stop
> while (!CheckDone(2)) ; // loop until motion completes
> DisableAxis(2); // disable the axis
> Zero(2); // Zero the position
> EnableAxis(2); // re-enable the ServoTick
> Move(2,-1000.0); // move some amount inside the limits
> while (!CheckDone(2)) ; // loop until motion completes
> ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
>
> // Home X next - jog until it sees the limit
>
> Jog(0,-100); // jog slowly negative
> while (!ReadBit(10)) ; // loop until IO bit goes high
> Jog(0,0); // stop
> while (!CheckDone(0)) ; // loop until motion completes
> DisableAxis(0); // disable the axis
> Zero(0); // Zero the position
> EnableAxis(0); // re-enable the ServoTick
> Move(0,1000.0); // move some amount inside the limits
> while (!CheckDone(0)) ; // loop until motion completes
> ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
>
> // Home Y next - jog until it sees the limit
>
> Jog(1,-100); // jog slowly negative
> while (!ReadBit(9)) ; // loop until IO bit goes high
> Jog(1,0); // stop
> while (!CheckDone(1)) ; // loop until motion completes
> DisableAxis(1); // disable the axis
> Zero(1); // Zero the position
> EnableAxis(1); // re-enable the ServoTick
> Move(1,1000.0); // move some amount inside the limits
> while (!CheckDone(1)) ; // loop until motion completes
> ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
>
> DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> }
>
> Thanks for all your help
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > Let's see:  at 160 steps/mm x 10000mm/min x  1mm / 60sec = 26,666 steps/sec
> > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> >  
> > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.  Most Stepper motors have very limited torque beyond that step rate. 
> >
> > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3. 
> >  
> > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.  Then test if the input toggles properly using the Digital I/O Screen.  If so, then configure the Limit Settings on the Config/Flash Screen.  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.  Use the "Disallow drive into limit" mode.  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> >  
> > No sorry SnapAmp doesn't have any 0-10V analog outputs.  But yes it can drive steppers, brushless, or brush motors.
> >  
> > Regards
> > TK
> >  
> >
> > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Monday, June 20, 2011, 2:13 PM
> >
> >
> >  
> >
> >
> >
> > Hi TK
> > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > What is the max I can run?(I'm a speed demon)
> > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > Thanks again
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > Hi John,
> > >  
> > > That's good progress.
> > >  
> > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > >  
> > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > >  
> > > The indicated Home Inputs are just recommendations.  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.  Or put a 100 ohm resistor in series.
> > >  
> > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.  Maybe you have one already?  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > >
> > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Monday, June 20, 2011, 4:08 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi TK,
> > >
> > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > Next question is the limit switches.
> > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > >
> > > Thanks for your help we are getting there.
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > > ÃÆ'‚ 
> > > > Did you read the links I sent?ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'‚  The button doesn't do anything directly.ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > ÃÆ'‚ 
> > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > ÃÆ'‚ 
> > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > ÃÆ'‚ 
> > > > Regards
> > > > TK
> > > >
> > > >
> > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > >
> > > > Hi TK,
> > > >
> > > > Thanks for thr quick reply,
> > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > Thanks for your quick response.
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'Æ'‚ÃÆ'‚ function callÃÆ'Æ'‚ÃÆ'‚ such asÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > >
> > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > HTH
> > > > > TK
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > >
> > > > >
> > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > >
> > > > >
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi All,
> > > > >
> > > > > Im new to the Kflop board just got it out today for play.
> > > > > I have managed to install the software and wire up a stepper motor.
> > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > >
> > > > > Thanks
> > > > >
> > > > > John
> > > > >
> > > >
> > >
> >
>

Group: DynoMotion Message: 1357 From: jonny1bar Date: 6/24/2011
Subject: Re: Newbe needs help
Hi Tom

Yes I use 1 switch for homeing and limit on each axis.
Could you compile a c program for me to get the limit switches working so I can see what you have done.
I am new to all this and need all the help I can get.
I know of people that can help me but not sure how much it will cost.
Thanks

John
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> The error is because you have a line of code to restore the Limit Switch Options but you never saved the options and a location to save them was never declared. 
>  
> Are you using the same switch for homing and a limit?  If you are then you need to:
>
> #1 declare a place to save the original settings
>     Add an integer variable (inside the main function just after the bracket) with
>  
>     int SaveZLimits;
>  
>  
> #2 save them before homing
>  
>    SaveZLimits = ch2->LimitSwitchOptions; // save original limit settings
>
> #3 disable the limits
>  
> ch2->LimitSwitchOptions = 0;  // disable limits
>  
>  
> #4 restore them (after homing)
>  
> ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
>
>  
>  
> If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
>  
>  
> Regards
> TK
>  
>
>
> --- On Thu, 6/23/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Thursday, June 23, 2011, 10:43 AM
>
>
>  
>
>
>
> Hi Tom,
>
> Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> If it works can i try it through mach3.
> I have just worked out you can run the program from the c screen.
> Were so close I can taste it.
>
> Thanks
>
> John
>
> #include "KMotionDef.h"
>
> // Configuration and Homing program for a 3 axis System
> // Limit switches are disabled and used as a home switch
> // then they are re-enabled
>
> main()
> {
>
>
> // enable all 3 axes and begin servoing where we are
>
> EnableAxis(0);
> EnableAxis(1);
> EnableAxis(2);
>
> // Home Z up first - jog until it sees the limit
>
> Jog(2,100); // jog slowly positive
> while (!ReadBit(10)) ; // loop until IO bit goes high
> Jog(2,0); // stop
> while (!CheckDone(2)) ; // loop until motion completes
> DisableAxis(2); // disable the axis
> Zero(2); // Zero the position
> EnableAxis(2); // re-enable the ServoTick
> Move(2,-1000.0); // move some amount inside the limits
> while (!CheckDone(2)) ; // loop until motion completes
> ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
>
> // Home X next - jog until it sees the limit
>
> Jog(0,-100); // jog slowly negative
> while (!ReadBit(10)) ; // loop until IO bit goes high
> Jog(0,0); // stop
> while (!CheckDone(0)) ; // loop until motion completes
> DisableAxis(0); // disable the axis
> Zero(0); // Zero the position
> EnableAxis(0); // re-enable the ServoTick
> Move(0,1000.0); // move some amount inside the limits
> while (!CheckDone(0)) ; // loop until motion completes
> ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
>
> // Home Y next - jog until it sees the limit
>
> Jog(1,-100); // jog slowly negative
> while (!ReadBit(9)) ; // loop until IO bit goes high
> Jog(1,0); // stop
> while (!CheckDone(1)) ; // loop until motion completes
> DisableAxis(1); // disable the axis
> Zero(1); // Zero the position
> EnableAxis(1); // re-enable the ServoTick
> Move(1,1000.0); // move some amount inside the limits
> while (!CheckDone(1)) ; // loop until motion completes
> ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
>
> DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> }
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > The code looks reasonable to me.  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> >  
> > For Mach3 each axis is homed separately.  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> >  
> > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> >  
> > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.  Which is the Jog, wait for switch, stop.  See if that works.
> >  
> > Regards,
> > TK
> >
> >
> > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Wednesday, June 22, 2011, 11:05 AM
> >
> >
> >  
> >
> >
> >
> > Hi Tom,
> >
> > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > When you jog the axis and then press the limit switch the axis stops as it should.
> > Can you help me with motor step response settings I havent got a clue what i am doing.
> >
> > Can you also have a quick look at axis C code
> >
> > #include "KMotionDef.h"
> >
> > // Defines axis 0, 1, 2 as simple step dir outputs
> > // enables them
> > // sets them as an xyz coordinate system for GCode
> >
> > int main()
> > {
> > ch0->InputMode=NO_INPUT_MODE;
> > ch0->OutputMode=STEP_DIR_MODE;
> > ch0->Vel=40000;
> > ch0->Accel=400000;
> > ch0->Jerk=4000000;
> > ch0->P=0;
> > ch0->I=0.009999999776483;
> > ch0->D=0;
> > ch0->FFAccel=0;
> > ch0->FFVel=0;
> > ch0->MaxI=200;
> > ch0->MaxErr=1000000;
> > ch0->MaxOutput=200;
> > ch0->DeadBandGain=1;
> > ch0->DeadBandRange=0;
> > ch0->InputChan0=2;
> > ch0->InputChan1=0;
> > ch0->OutputChan0=2;
> > ch0->OutputChan1=0;
> > ch0->MasterAxis=-1;
> > ch0->LimitSwitchOptions=0x0;
> > ch0->InputGain0=1;
> > ch0->InputGain1=1;
> > ch0->InputOffset0=0;
> > ch0->InputOffset1=0;
> > ch0->OutputGain=1;
> > ch0->OutputOffset=0;
> > ch0->SlaveGain=1;
> > ch0->BacklashMode=BACKLASH_OFF;
> > ch0->BacklashAmount=0;
> > ch0->BacklashRate=0;
> > ch0->invDistPerCycle=1;
> > ch0->Lead=0;
> > ch0->MaxFollowingError=1000000000;
> > ch0->StepperAmplitude=20;
> >
> > ch0->iir[0].B0=1;
> > ch0->iir[0].B1=0;
> > ch0->iir[0].B2=0;
> > ch0->iir[0].A1=0;
> > ch0->iir[0].A2=0;
> >
> > ch0->iir[1].B0=1;
> > ch0->iir[1].B1=0;
> > ch0->iir[1].B2=0;
> > ch0->iir[1].A1=0;
> > ch0->iir[1].A2=0;
> >
> > ch0->iir[2].B0=0.0007689999765716;
> > ch0->iir[2].B1=0.001537999953143;
> > ch0->iir[2].B2=0.0007689999765716;
> > ch0->iir[2].A1=1.920809984207;
> > ch0->iir[2].A2=-0.9238849878311;
> > EnableAxisDest(0,0);
> >
> > ch1->InputMode=NO_INPUT_MODE;
> > ch1->OutputMode=STEP_DIR_MODE;
> > ch1->Vel=40000;
> > ch1->Accel=400000;
> > ch1->Jerk=4000000;
> > ch1->P=0;
> > ch1->I=0.009999999776483;
> > ch1->D=0;
> > ch1->FFAccel=0;
> > ch1->FFVel=0;
> > ch1->MaxI=200;
> > ch1->MaxErr=1000000;
> > ch1->MaxOutput=200;
> > ch1->DeadBandGain=1;
> > ch1->DeadBandRange=0;
> > ch1->InputChan0=2;
> > ch1->InputChan1=0;
> > ch1->OutputChan0=2;
> > ch1->OutputChan1=0;
> > ch1->MasterAxis=-1;
> > ch1->LimitSwitchOptions=0x0;
> > ch1->InputGain0=1;
> > ch1->InputGain1=1;
> > ch1->InputOffset0=0;
> > ch1->InputOffset1=0;
> > ch1->OutputGain=1;
> > ch1->OutputOffset=0;
> > ch1->SlaveGain=1;
> > ch1->BacklashMode=BACKLASH_OFF;
> > ch1->BacklashAmount=0;
> > ch1->BacklashRate=0;
> > ch1->invDistPerCycle=1;
> > ch1->Lead=0;
> > ch1->MaxFollowingError=1000000000;
> > ch1->StepperAmplitude=20;
> >
> > ch1->iir[0].B0=1;
> > ch1->iir[0].B1=0;
> > ch1->iir[0].B2=0;
> > ch1->iir[0].A1=0;
> > ch1->iir[0].A2=0;
> >
> > ch1->iir[1].B0=1;
> > ch1->iir[1].B1=0;
> > ch1->iir[1].B2=0;
> > ch1->iir[1].A1=0;
> > ch1->iir[1].A2=0;
> >
> > ch1->iir[2].B0=0.0007689999765716;
> > ch1->iir[2].B1=0.001537999953143;
> > ch1->iir[2].B2=0.0007689999765716;
> > ch1->iir[2].A1=1.920809984207;
> > ch1->iir[2].A2=-0.9238849878311;
> > EnableAxisDest(1,0);
> >
> > ch2->InputMode=NO_INPUT_MODE;
> > ch2->OutputMode=STEP_DIR_MODE;
> > ch2->Vel=40000;
> > ch2->Accel=400000;
> > ch2->Jerk=4000000;
> > ch2->P=0;
> > ch2->I=0.009999999776483;
> > ch2->D=0;
> > ch2->FFAccel=0;
> > ch2->FFVel=0;
> > ch2->MaxI=200;
> > ch2->MaxErr=1000000;
> > ch2->MaxOutput=200;
> > ch2->DeadBandGain=1;
> > ch2->DeadBandRange=0;
> > ch2->InputChan0=0;
> > ch2->InputChan1=0;
> > ch2->OutputChan0=0;
> > ch2->OutputChan1=0;
> > ch2->MasterAxis=-1;
> > ch2->LimitSwitchOptions=0x30015;
> > ch2->InputGain0=1;
> > ch2->InputGain1=1;
> > ch2->InputOffset0=0;
> > ch2->InputOffset1=0;
> > ch2->OutputGain=1;
> > ch2->OutputOffset=0;
> > ch2->SlaveGain=1;
> > ch2->BacklashMode=BACKLASH_OFF;
> > ch2->BacklashAmount=0;
> > ch2->BacklashRate=0;
> > ch2->invDistPerCycle=1;
> > ch2->Lead=0;
> > ch2->MaxFollowingError=1000000000;
> > ch2->StepperAmplitude=20;
> >
> > ch2->iir[0].B0=1;
> > ch2->iir[0].B1=0;
> > ch2->iir[0].B2=0;
> > ch2->iir[0].A1=0;
> > ch2->iir[0].A2=0;
> >
> > ch2->iir[1].B0=1;
> > ch2->iir[1].B1=0;
> > ch2->iir[1].B2=0;
> > ch2->iir[1].A1=0;
> > ch2->iir[1].A2=0;
> >
> > ch2->iir[2].B0=0.0007689999765716;
> > ch2->iir[2].B1=0.001537999953143;
> > ch2->iir[2].B2=0.0007689999765716;
> > ch2->iir[2].A1=1.920809984207;
> > ch2->iir[2].A2=-0.9238849878311;
> > EnableAxisDest(2,0);
> >
> > DefineCoordSystem(0,1,2,-1);
> >
> > return 0;
> > }
> >
> > And this is the one for the home switches.
> >
> > #include "KMotionDef.h"
> >
> > // Configuration and Homing program for a 3 axis System
> > // Limit switches are disabled and used as a home switch
> > // then they are re-enabled
> >
> > main()
> > {
> > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> >
> > DisableAxis(0); // Disable all axes
> > DisableAxis(1);
> > DisableAxis(2);
> >
> > // Set the axis parameters here
> > // after everything is configured in the KMotion Screens
> > // use copy C Code to clipboard on the configuration screen
> > // then paste here. Repeat for each axis
> >
> > ch0->InputMode=NO_INPUT_MODE;
> > ch0->OutputMode=STEP_DIR_MODE;
> > ch0->Vel=40000;
> > ch0->Accel=400000;
> > ch0->Jerk=4000000;
> > ch0->P=0;
> > ch0->I=0.009999999776483;
> > ch0->D=0;
> > ch0->FFAccel=0;
> > ch0->FFVel=0;
> > ch0->MaxI=200;
> > ch0->MaxErr=1000000;
> > ch0->MaxOutput=200;
> > ch0->DeadBandGain=1;
> > ch0->DeadBandRange=0;
> > ch0->InputChan0=2;
> > ch0->InputChan1=0;
> > ch0->OutputChan0=2;
> > ch0->OutputChan1=0;
> > ch0->MasterAxis=-1;
> > ch0->LimitSwitchOptions=0x0;
> > ch0->InputGain0=1;
> > ch0->InputGain1=1;
> > ch0->InputOffset0=0;
> > ch0->InputOffset1=0;
> > ch0->OutputGain=1;
> > ch0->OutputOffset=0;
> > ch0->SlaveGain=1;
> > ch0->BacklashMode=BACKLASH_OFF;
> > ch0->BacklashAmount=0;
> > ch0->BacklashRate=0;
> > ch0->invDistPerCycle=1;
> > ch0->Lead=0;
> > ch0->MaxFollowingError=1000000000;
> > ch0->StepperAmplitude=20;
> >
> > ch0->iir[0].B0=1;
> > ch0->iir[0].B1=0;
> > ch0->iir[0].B2=0;
> > ch0->iir[0].A1=0;
> > ch0->iir[0].A2=0;
> >
> > ch0->iir[1].B0=1;
> > ch0->iir[1].B1=0;
> > ch0->iir[1].B2=0;
> > ch0->iir[1].A1=0;
> > ch0->iir[1].A2=0;
> >
> > ch0->iir[2].B0=0.0007689999765716;
> > ch0->iir[2].B1=0.001537999953143;
> > ch0->iir[2].B2=0.0007689999765716;
> > ch0->iir[2].A1=1.920809984207;
> > ch0->iir[2].A2=-0.9238849878311;
> >
> > ch1->InputMode=NO_INPUT_MODE;
> > ch1->OutputMode=STEP_DIR_MODE;
> > ch1->Vel=40000;
> > ch1->Accel=400000;
> > ch1->Jerk=4000000;
> > ch1->P=0;
> > ch1->I=0.009999999776483;
> > ch1->D=0;
> > ch1->FFAccel=0;
> > ch1->FFVel=0;
> > ch1->MaxI=200;
> > ch1->MaxErr=1000000;
> > ch1->MaxOutput=200;
> > ch1->DeadBandGain=1;
> > ch1->DeadBandRange=0;
> > ch1->InputChan0=2;
> > ch1->InputChan1=0;
> > ch1->OutputChan0=2;
> > ch1->OutputChan1=0;
> > ch1->MasterAxis=-1;
> > ch1->LimitSwitchOptions=0x0;
> > ch1->InputGain0=1;
> > ch1->InputGain1=1;
> > ch1->InputOffset0=0;
> > ch1->InputOffset1=0;
> > ch1->OutputGain=1;
> > ch1->OutputOffset=0;
> > ch1->SlaveGain=1;
> > ch1->BacklashMode=BACKLASH_OFF;
> > ch1->BacklashAmount=0;
> > ch1->BacklashRate=0;
> > ch1->invDistPerCycle=1;
> > ch1->Lead=0;
> > ch1->MaxFollowingError=1000000000;
> > ch1->StepperAmplitude=20;
> >
> > ch1->iir[0].B0=1;
> > ch1->iir[0].B1=0;
> > ch1->iir[0].B2=0;
> > ch1->iir[0].A1=0;
> > ch1->iir[0].A2=0;
> >
> > ch1->iir[1].B0=1;
> > ch1->iir[1].B1=0;
> > ch1->iir[1].B2=0;
> > ch1->iir[1].A1=0;
> > ch1->iir[1].A2=0;
> >
> > ch1->iir[2].B0=0.0007689999765716;
> > ch1->iir[2].B1=0.001537999953143;
> > ch1->iir[2].B2=0.0007689999765716;
> > ch1->iir[2].A1=1.920809984207;
> > ch1->iir[2].A2=-0.9238849878311;
> >
> > ch2->InputMode=NO_INPUT_MODE;
> > ch2->OutputMode=STEP_DIR_MODE;
> > ch2->Vel=40000;
> > ch2->Accel=400000;
> > ch2->Jerk=4000000;
> > ch2->P=0;
> > ch2->I=0.009999999776483;
> > ch2->D=0;
> > ch2->FFAccel=0;
> > ch2->FFVel=0;
> > ch2->MaxI=200;
> > ch2->MaxErr=1000000;
> > ch2->MaxOutput=200;
> > ch2->DeadBandGain=1;
> > ch2->DeadBandRange=0;
> > ch2->InputChan0=0;
> > ch2->InputChan1=0;
> > ch2->OutputChan0=0;
> > ch2->OutputChan1=0;
> > ch2->MasterAxis=-1;
> > ch2->LimitSwitchOptions=0x30015;
> > ch2->InputGain0=1;
> > ch2->InputGain1=1;
> > ch2->InputOffset0=0;
> > ch2->InputOffset1=0;
> > ch2->OutputGain=1;
> > ch2->OutputOffset=0;
> > ch2->SlaveGain=1;
> > ch2->BacklashMode=BACKLASH_OFF;
> > ch2->BacklashAmount=0;
> > ch2->BacklashRate=0;
> > ch2->invDistPerCycle=1;
> > ch2->Lead=0;
> > ch2->MaxFollowingError=1000000000;
> > ch2->StepperAmplitude=20;
> >
> > ch2->iir[0].B0=1;
> > ch2->iir[0].B1=0;
> > ch2->iir[0].B2=0;
> > ch2->iir[0].A1=0;
> > ch2->iir[0].A2=0;
> >
> > ch2->iir[1].B0=1;
> > ch2->iir[1].B1=0;
> > ch2->iir[1].B2=0;
> > ch2->iir[1].A1=0;
> > ch2->iir[1].A2=0;
> >
> > ch2->iir[2].B0=0.0007689999765716;
> > ch2->iir[2].B1=0.001537999953143;
> > ch2->iir[2].B2=0.0007689999765716;
> > ch2->iir[2].A1=1.920809984207;
> > ch2->iir[2].A2=-0.9238849878311;
> >
> >
> >
> >
> >
> > // disable the limits (first save how they were set)
> > SaveXLimits = ch0->LimitSwitchOptions;
> > SaveYLimits = ch1->LimitSwitchOptions;
> > SaveZLimits = ch2->LimitSwitchOptions;
> > ch0->LimitSwitchOptions = 0;
> > ch1->LimitSwitchOptions = 0;
> > ch2->LimitSwitchOptions = 0;
> >
> > // enable all 3 axes and begin servoing where we are
> >
> > EnableAxis(0);
> > EnableAxis(1);
> > EnableAxis(2);
> >
> > // Home Z up first - jog until it sees the limit
> >
> > Jog(2,100); // jog slowly positive
> > while (!ReadBit(10)) ; // loop until IO bit goes high
> > Jog(2,0); // stop
> > while (!CheckDone(2)) ; // loop until motion completes
> > DisableAxis(2); // disable the axis
> > Zero(2); // Zero the position
> > EnableAxis(2); // re-enable the ServoTick
> > Move(2,-1000.0); // move some amount inside the limits
> > while (!CheckDone(2)) ; // loop until motion completes
> > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> >
> > // Home X next - jog until it sees the limit
> >
> > Jog(0,-100); // jog slowly negative
> > while (!ReadBit(10)) ; // loop until IO bit goes high
> > Jog(0,0); // stop
> > while (!CheckDone(0)) ; // loop until motion completes
> > DisableAxis(0); // disable the axis
> > Zero(0); // Zero the position
> > EnableAxis(0); // re-enable the ServoTick
> > Move(0,1000.0); // move some amount inside the limits
> > while (!CheckDone(0)) ; // loop until motion completes
> > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> >
> > // Home Y next - jog until it sees the limit
> >
> > Jog(1,-100); // jog slowly negative
> > while (!ReadBit(9)) ; // loop until IO bit goes high
> > Jog(1,0); // stop
> > while (!CheckDone(1)) ; // loop until motion completes
> > DisableAxis(1); // disable the axis
> > Zero(1); // Zero the position
> > EnableAxis(1); // re-enable the ServoTick
> > Move(1,1000.0); // move some amount inside the limits
> > while (!CheckDone(1)) ; // loop until motion completes
> > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> >
> > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > }
> >
> > Thanks for all your help
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > Let's see:  at 160 steps/mm x 10000mm/min x  1mm / 60sec = 26,666 steps/sec
> > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > >  
> > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.  Most Stepper motors have very limited torque beyond that step rate. 
> > >
> > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3. 
> > >  
> > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.  Then test if the input toggles properly using the Digital I/O Screen.  If so, then configure the Limit Settings on the Config/Flash Screen.  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.  Use the "Disallow drive into limit" mode.  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > >  
> > > No sorry SnapAmp doesn't have any 0-10V analog outputs.  But yes it can drive steppers, brushless, or brush motors.
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Monday, June 20, 2011, 2:13 PM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi TK
> > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > What is the max I can run?(I'm a speed demon)
> > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > Thanks again
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Hi John,
> > > > ÃÆ'‚ 
> > > > That's good progress.
> > > > ÃÆ'‚ 
> > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > ÃÆ'‚ 
> > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > ÃÆ'‚ 
> > > > The indicated Home Inputs are just recommendations.ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > ÃÆ'‚ 
> > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'‚  Maybe you have one already?ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > ÃÆ'‚ 
> > > > Regards
> > > > TK
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Monday, June 20, 2011, 4:08 AM
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > >
> > > > Hi TK,
> > > >
> > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > Next question is the limit switches.
> > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > >
> > > > Thanks for your help we are getting there.
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > Did you read the links I sent?ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything directly.ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > Regards
> > > > > TK
> > > > >
> > > > >
> > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > >
> > > > >
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi TK,
> > > > >
> > > > > Thanks for thr quick reply,
> > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > Thanks for your quick response.
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ function callÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ such asÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > > >
> > > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > HTH
> > > > > > TK
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi All,
> > > > > >
> > > > > > Im new to the Kflop board just got it out today for play.
> > > > > > I have managed to install the software and wire up a stepper motor.
> > > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > John
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 1358 From: Tom Kerekes Date: 6/24/2011
Subject: Re: Newbe needs help
Attachments :
Hi John,
 
See Attached
 
Software is very expensive :}
 
TK

--- On Fri, 6/24/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Friday, June 24, 2011, 1:17 PM

 

Hi Tom

Yes I use 1 switch for homeing and limit on each axis.
Could you compile a c program for me to get the limit switches working so I can see what you have done.
I am new to all this and need all the help I can get.
I know of people that can help me but not sure how much it will cost.
Thanks

John
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> The error is because you have a line of code to restore the Limit Switch Options but you never saved the options and a location to save them was never declared. 
>  
> Are you using the same switch for homing and a limit?  If you are then you need to:
>
> #1 declare a place to save the original settings
>     Add an integer variable (inside the main function just after the bracket) with
>  
>     int SaveZLimits;
>  
>  
> #2 save them before homing
>  
>    SaveZLimits = ch2->LimitSwitchOptions; // save original limit settings
>
> #3 disable the limits
>  
> ch2->LimitSwitchOptions = 0;  // disable limits
>  
>  
> #4 restore them (after homing)
>  
> ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
>
>  
>  
> If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
>  
>  
> Regards
> TK
>  
>
>
> --- On Thu, 6/23/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Thursday, June 23, 2011, 10:43 AM
>
>
>  
>
>
>
> Hi Tom,
>
> Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> If it works can i try it through mach3.
> I have just worked out you can run the program from the c screen.
> Were so close I can taste it.
>
> Thanks
>
> John
>
> #include "KMotionDef.h"
>
> // Configuration and Homing program for a 3 axis System
> // Limit switches are disabled and used as a home switch
> // then they are re-enabled
>
> main()
> {
>
>
> // enable all 3 axes and begin servoing where we are
>
> EnableAxis(0);
> EnableAxis(1);
> EnableAxis(2);
>
> // Home Z up first - jog until it sees the limit
>
> Jog(2,100); // jog slowly positive
> while (!ReadBit(10)) ; // loop until IO bit goes high
> Jog(2,0); // stop
> while (!CheckDone(2)) ; // loop until motion completes
> DisableAxis(2); // disable the axis
> Zero(2); // Zero the position
> EnableAxis(2); // re-enable the ServoTick
> Move(2,-1000.0); // move some amount inside the limits
> while (!CheckDone(2)) ; // loop until motion completes
> ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
>
> // Home X next - jog until it sees the limit
>
> Jog(0,-100); // jog slowly negative
> while (!ReadBit(10)) ; // loop until IO bit goes high
> Jog(0,0); // stop
> while (!CheckDone(0)) ; // loop until motion completes
> DisableAxis(0); // disable the axis
> Zero(0); // Zero the position
> EnableAxis(0); // re-enable the ServoTick
> Move(0,1000.0); // move some amount inside the limits
> while (!CheckDone(0)) ; // loop until motion completes
> ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
>
> // Home Y next - jog until it sees the limit
>
> Jog(1,-100); // jog slowly negative
> while (!ReadBit(9)) ; // loop until IO bit goes high
> Jog(1,0); // stop
> while (!CheckDone(1)) ; // loop until motion completes
> DisableAxis(1); // disable the axis
> Zero(1); // Zero the position
> EnableAxis(1); // re-enable the ServoTick
> Move(1,1000.0); // move some amount inside the limits
> while (!CheckDone(1)) ; // loop until motion completes
> ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
>
> DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> }
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > The code looks reasonable to me.  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> >  
> > For Mach3 each axis is homed separately.  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> >  
> > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> >  
> > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.  Which is the Jog, wait for switch, stop.  See if that works.
> >  
> > Regards,
> > TK
> >
> >
> > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Wednesday, June 22, 2011, 11:05 AM
> >
> >
> >  
> >
> >
> >
> > Hi Tom,
> >
> > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > When you jog the axis and then press the limit switch the axis stops as it should.
> > Can you help me with motor step response settings I havent got a clue what i am doing.
> >
> > Can you also have a quick look at axis C code
> >
> > #include "KMotionDef.h"
> >
> > // Defines axis 0, 1, 2 as simple step dir outputs
> > // enables them
> > // sets them as an xyz coordinate system for GCode
> >
> > int main()
> > {
> > ch0->InputMode=NO_INPUT_MODE;
> > ch0->OutputMode=STEP_DIR_MODE;
> > ch0->Vel=40000;
> > ch0->Accel=400000;
> > ch0->Jerk=4000000;
> > ch0->P=0;
> > ch0->I=0.009999999776483;
> > ch0->D=0;
> > ch0->FFAccel=0;
> > ch0->FFVel=0;
> > ch0->MaxI=200;
> > ch0->MaxErr=1000000;
> > ch0->MaxOutput=200;
> > ch0->DeadBandGain=1;
> > ch0->DeadBandRange=0;
> > ch0->InputChan0=2;
> > ch0->InputChan1=0;
> > ch0->OutputChan0=2;
> > ch0->OutputChan1=0;
> > ch0->MasterAxis=-1;
> > ch0->LimitSwitchOptions=0x0;
> > ch0->InputGain0=1;
> > ch0->InputGain1=1;
> > ch0->InputOffset0=0;
> > ch0->InputOffset1=0;
> > ch0->OutputGain=1;
> > ch0->OutputOffset=0;
> > ch0->SlaveGain=1;
> > ch0->BacklashMode=BACKLASH_OFF;
> > ch0->BacklashAmount=0;
> > ch0->BacklashRate=0;
> > ch0->invDistPerCycle=1;
> > ch0->Lead=0;
> > ch0->MaxFollowingError=1000000000;
> > ch0->StepperAmplitude=20;
> >
> > ch0->iir[0].B0=1;
> > ch0->iir[0].B1=0;
> > ch0->iir[0].B2=0;
> > ch0->iir[0].A1=0;
> > ch0->iir[0].A2=0;
> >
> > ch0->iir[1].B0=1;
> > ch0->iir[1].B1=0;
> > ch0->iir[1].B2=0;
> > ch0->iir[1].A1=0;
> > ch0->iir[1].A2=0;
> >
> > ch0->iir[2].B0=0.0007689999765716;
> > ch0->iir[2].B1=0.001537999953143;
> > ch0->iir[2].B2=0.0007689999765716;
> > ch0->iir[2].A1=1.920809984207;
> > ch0->iir[2].A2=-0.9238849878311;
> > EnableAxisDest(0,0);
> >
> > ch1->InputMode=NO_INPUT_MODE;
> > ch1->OutputMode=STEP_DIR_MODE;
> > ch1->Vel=40000;
> > ch1->Accel=400000;
> > ch1->Jerk=4000000;
> > ch1->P=0;
> > ch1->I=0.009999999776483;
> > ch1->D=0;
> > ch1->FFAccel=0;
> > ch1->FFVel=0;
> > ch1->MaxI=200;
> > ch1->MaxErr=1000000;
> > ch1->MaxOutput=200;
> > ch1->DeadBandGain=1;
> > ch1->DeadBandRange=0;
> > ch1->InputChan0=2;
> > ch1->InputChan1=0;
> > ch1->OutputChan0=2;
> > ch1->OutputChan1=0;
> > ch1->MasterAxis=-1;
> > ch1->LimitSwitchOptions=0x0;
> > ch1->InputGain0=1;
> > ch1->InputGain1=1;
> > ch1->InputOffset0=0;
> > ch1->InputOffset1=0;
> > ch1->OutputGain=1;
> > ch1->OutputOffset=0;
> > ch1->SlaveGain=1;
> > ch1->BacklashMode=BACKLASH_OFF;
> > ch1->BacklashAmount=0;
> > ch1->BacklashRate=0;
> > ch1->invDistPerCycle=1;
> > ch1->Lead=0;
> > ch1->MaxFollowingError=1000000000;
> > ch1->StepperAmplitude=20;
> >
> > ch1->iir[0].B0=1;
> > ch1->iir[0].B1=0;
> > ch1->iir[0].B2=0;
> > ch1->iir[0].A1=0;
> > ch1->iir[0].A2=0;
> >
> > ch1->iir[1].B0=1;
> > ch1->iir[1].B1=0;
> > ch1->iir[1].B2=0;
> > ch1->iir[1].A1=0;
> > ch1->iir[1].A2=0;
> >
> > ch1->iir[2].B0=0.0007689999765716;
> > ch1->iir[2].B1=0.001537999953143;
> > ch1->iir[2].B2=0.0007689999765716;
> > ch1->iir[2].A1=1.920809984207;
> > ch1->iir[2].A2=-0.9238849878311;
> > EnableAxisDest(1,0);
> >
> > ch2->InputMode=NO_INPUT_MODE;
> > ch2->OutputMode=STEP_DIR_MODE;
> > ch2->Vel=40000;
> > ch2->Accel=400000;
> > ch2->Jerk=4000000;
> > ch2->P=0;
> > ch2->I=0.009999999776483;
> > ch2->D=0;
> > ch2->FFAccel=0;
> > ch2->FFVel=0;
> > ch2->MaxI=200;
> > ch2->MaxErr=1000000;
> > ch2->MaxOutput=200;
> > ch2->DeadBandGain=1;
> > ch2->DeadBandRange=0;
> > ch2->InputChan0=0;
> > ch2->InputChan1=0;
> > ch2->OutputChan0=0;
> > ch2->OutputChan1=0;
> > ch2->MasterAxis=-1;
> > ch2->LimitSwitchOptions=0x30015;
> > ch2->InputGain0=1;
> > ch2->InputGain1=1;
> > ch2->InputOffset0=0;
> > ch2->InputOffset1=0;
> > ch2->OutputGain=1;
> > ch2->OutputOffset=0;
> > ch2->SlaveGain=1;
> > ch2->BacklashMode=BACKLASH_OFF;
> > ch2->BacklashAmount=0;
> > ch2->BacklashRate=0;
> > ch2->invDistPerCycle=1;
> > ch2->Lead=0;
> > ch2->MaxFollowingError=1000000000;
> > ch2->StepperAmplitude=20;
> >
> > ch2->iir[0].B0=1;
> > ch2->iir[0].B1=0;
> > ch2->iir[0].B2=0;
> > ch2->iir[0].A1=0;
> > ch2->iir[0].A2=0;
> >
> > ch2->iir[1].B0=1;
> > ch2->iir[1].B1=0;
> > ch2->iir[1].B2=0;
> > ch2->iir[1].A1=0;
> > ch2->iir[1].A2=0;
> >
> > ch2->iir[2].B0=0.0007689999765716;
> > ch2->iir[2].B1=0.001537999953143;
> > ch2->iir[2].B2=0.0007689999765716;
> > ch2->iir[2].A1=1.920809984207;
> > ch2->iir[2].A2=-0.9238849878311;
> > EnableAxisDest(2,0);
> >
> > DefineCoordSystem(0,1,2,-1);
> >
> > return 0;
> > }
> >
> > And this is the one for the home switches.
> >
> > #include "KMotionDef.h"
> >
> > // Configuration and Homing program for a 3 axis System
> > // Limit switches are disabled and used as a home switch
> > // then they are re-enabled
> >
> > main()
> > {
> > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> >
> > DisableAxis(0); // Disable all axes
> > DisableAxis(1);
> > DisableAxis(2);
> >
> > // Set the axis parameters here
> > // after everything is configured in the KMotion Screens
> > // use copy C Code to clipboard on the configuration screen
> > // then paste here. Repeat for each axis
> >
> > ch0->InputMode=NO_INPUT_MODE;
> > ch0->OutputMode=STEP_DIR_MODE;
> > ch0->Vel=40000;
> > ch0->Accel=400000;
> > ch0->Jerk=4000000;
> > ch0->P=0;
> > ch0->I=0.009999999776483;
> > ch0->D=0;
> > ch0->FFAccel=0;
> > ch0->FFVel=0;
> > ch0->MaxI=200;
> > ch0->MaxErr=1000000;
> > ch0->MaxOutput=200;
> > ch0->DeadBandGain=1;
> > ch0->DeadBandRange=0;
> > ch0->InputChan0=2;
> > ch0->InputChan1=0;
> > ch0->OutputChan0=2;
> > ch0->OutputChan1=0;
> > ch0->MasterAxis=-1;
> > ch0->LimitSwitchOptions=0x0;
> > ch0->InputGain0=1;
> > ch0->InputGain1=1;
> > ch0->InputOffset0=0;
> > ch0->InputOffset1=0;
> > ch0->OutputGain=1;
> > ch0->OutputOffset=0;
> > ch0->SlaveGain=1;
> > ch0->BacklashMode=BACKLASH_OFF;
> > ch0->BacklashAmount=0;
> > ch0->BacklashRate=0;
> > ch0->invDistPerCycle=1;
> > ch0->Lead=0;
> > ch0->MaxFollowingError=1000000000;
> > ch0->StepperAmplitude=20;
> >
> > ch0->iir[0].B0=1;
> > ch0->iir[0].B1=0;
> > ch0->iir[0].B2=0;
> > ch0->iir[0].A1=0;
> > ch0->iir[0].A2=0;
> >
> > ch0->iir[1].B0=1;
> > ch0->iir[1].B1=0;
> > ch0->iir[1].B2=0;
> > ch0->iir[1].A1=0;
> > ch0->iir[1].A2=0;
> >
> > ch0->iir[2].B0=0.0007689999765716;
> > ch0->iir[2].B1=0.001537999953143;
> > ch0->iir[2].B2=0.0007689999765716;
> > ch0->iir[2].A1=1.920809984207;
> > ch0->iir[2].A2=-0.9238849878311;
> >
> > ch1->InputMode=NO_INPUT_MODE;
> > ch1->OutputMode=STEP_DIR_MODE;
> > ch1->Vel=40000;
> > ch1->Accel=400000;
> > ch1->Jerk=4000000;
> > ch1->P=0;
> > ch1->I=0.009999999776483;
> > ch1->D=0;
> > ch1->FFAccel=0;
> > ch1->FFVel=0;
> > ch1->MaxI=200;
> > ch1->MaxErr=1000000;
> > ch1->MaxOutput=200;
> > ch1->DeadBandGain=1;
> > ch1->DeadBandRange=0;
> > ch1->InputChan0=2;
> > ch1->InputChan1=0;
> > ch1->OutputChan0=2;
> > ch1->OutputChan1=0;
> > ch1->MasterAxis=-1;
> > ch1->LimitSwitchOptions=0x0;
> > ch1->InputGain0=1;
> > ch1->InputGain1=1;
> > ch1->InputOffset0=0;
> > ch1->InputOffset1=0;
> > ch1->OutputGain=1;
> > ch1->OutputOffset=0;
> > ch1->SlaveGain=1;
> > ch1->BacklashMode=BACKLASH_OFF;
> > ch1->BacklashAmount=0;
> > ch1->BacklashRate=0;
> > ch1->invDistPerCycle=1;
> > ch1->Lead=0;
> > ch1->MaxFollowingError=1000000000;
> > ch1->StepperAmplitude=20;
> >
> > ch1->iir[0].B0=1;
> > ch1->iir[0].B1=0;
> > ch1->iir[0].B2=0;
> > ch1->iir[0].A1=0;
> > ch1->iir[0].A2=0;
> >
> > ch1->iir[1].B0=1;
> > ch1->iir[1].B1=0;
> > ch1->iir[1].B2=0;
> > ch1->iir[1].A1=0;
> > ch1->iir[1].A2=0;
> >
> > ch1->iir[2].B0=0.0007689999765716;
> > ch1->iir[2].B1=0.001537999953143;
> > ch1->iir[2].B2=0.0007689999765716;
> > ch1->iir[2].A1=1.920809984207;
> > ch1->iir[2].A2=-0.9238849878311;
> >
> > ch2->InputMode=NO_INPUT_MODE;
> > ch2->OutputMode=STEP_DIR_MODE;
> > ch2->Vel=40000;
> > ch2->Accel=400000;
> > ch2->Jerk=4000000;
> > ch2->P=0;
> > ch2->I=0.009999999776483;
> > ch2->D=0;
> > ch2->FFAccel=0;
> > ch2->FFVel=0;
> > ch2->MaxI=200;
> > ch2->MaxErr=1000000;
> > ch2->MaxOutput=200;
> > ch2->DeadBandGain=1;
> > ch2->DeadBandRange=0;
> > ch2->InputChan0=0;
> > ch2->InputChan1=0;
> > ch2->OutputChan0=0;
> > ch2->OutputChan1=0;
> > ch2->MasterAxis=-1;
> > ch2->LimitSwitchOptions=0x30015;
> > ch2->InputGain0=1;
> > ch2->InputGain1=1;
> > ch2->InputOffset0=0;
> > ch2->InputOffset1=0;
> > ch2->OutputGain=1;
> > ch2->OutputOffset=0;
> > ch2->SlaveGain=1;
> > ch2->BacklashMode=BACKLASH_OFF;
> > ch2->BacklashAmount=0;
> > ch2->BacklashRate=0;
> > ch2->invDistPerCycle=1;
> > ch2->Lead=0;
> > ch2->MaxFollowingError=1000000000;
> > ch2->StepperAmplitude=20;
> >
> > ch2->iir[0].B0=1;
> > ch2->iir[0].B1=0;
> > ch2->iir[0].B2=0;
> > ch2->iir[0].A1=0;
> > ch2->iir[0].A2=0;
> >
> > ch2->iir[1].B0=1;
> > ch2->iir[1].B1=0;
> > ch2->iir[1].B2=0;
> > ch2->iir[1].A1=0;
> > ch2->iir[1].A2=0;
> >
> > ch2->iir[2].B0=0.0007689999765716;
> > ch2->iir[2].B1=0.001537999953143;
> > ch2->iir[2].B2=0.0007689999765716;
> > ch2->iir[2].A1=1.920809984207;
> > ch2->iir[2].A2=-0.9238849878311;
> >
> >
> >
> >
> >
> > // disable the limits (first save how they were set)
> > SaveXLimits = ch0->LimitSwitchOptions;
> > SaveYLimits = ch1->LimitSwitchOptions;
> > SaveZLimits = ch2->LimitSwitchOptions;
> > ch0->LimitSwitchOptions = 0;
> > ch1->LimitSwitchOptions = 0;
> > ch2->LimitSwitchOptions = 0;
> >
> > // enable all 3 axes and begin servoing where we are
> >
> > EnableAxis(0);
> > EnableAxis(1);
> > EnableAxis(2);
> >
> > // Home Z up first - jog until it sees the limit
> >
> > Jog(2,100); // jog slowly positive
> > while (!ReadBit(10)) ; // loop until IO bit goes high
> > Jog(2,0); // stop
> > while (!CheckDone(2)) ; // loop until motion completes
> > DisableAxis(2); // disable the axis
> > Zero(2); // Zero the position
> > EnableAxis(2); // re-enable the ServoTick
> > Move(2,-1000.0); // move some amount inside the limits
> > while (!CheckDone(2)) ; // loop until motion completes
> > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> >
> > // Home X next - jog until it sees the limit
> >
> > Jog(0,-100); // jog slowly negative
> > while (!ReadBit(10)) ; // loop until IO bit goes high
> > Jog(0,0); // stop
> > while (!CheckDone(0)) ; // loop until motion completes
> > DisableAxis(0); // disable the axis
> > Zero(0); // Zero the position
> > EnableAxis(0); // re-enable the ServoTick
> > Move(0,1000.0); // move some amount inside the limits
> > while (!CheckDone(0)) ; // loop until motion completes
> > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> >
> > // Home Y next - jog until it sees the limit
> >
> > Jog(1,-100); // jog slowly negative
> > while (!ReadBit(9)) ; // loop until IO bit goes high
> > Jog(1,0); // stop
> > while (!CheckDone(1)) ; // loop until motion completes
> > DisableAxis(1); // disable the axis
> > Zero(1); // Zero the position
> > EnableAxis(1); // re-enable the ServoTick
> > Move(1,1000.0); // move some amount inside the limits
> > while (!CheckDone(1)) ; // loop until motion completes
> > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> >
> > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > }
> >
> > Thanks for all your help
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > Let's see:  at 160 steps/mm x 10000mm/min x  1mm / 60sec = 26,666 steps/sec
> > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > >  
> > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.  Most Stepper motors have very limited torque beyond that step rate. 
> > >
> > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3. 
> > >  
> > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.  Then test if the input toggles properly using the Digital I/O Screen.  If so, then configure the Limit Settings on the Config/Flash Screen.  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.  Use the "Disallow drive into limit" mode.  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > >  
> > > No sorry SnapAmp doesn't have any 0-10V analog outputs.  But yes it can drive steppers, brushless, or brush motors.
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Monday, June 20, 2011, 2:13 PM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi TK
> > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > What is the max I can run?(I'm a speed demon)
> > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > Thanks again
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Hi John,
> > > > ÃÆ'‚ 
> > > > That's good progress.
> > > > ÃÆ'‚ 
> > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > ÃÆ'‚ 
> > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > ÃÆ'‚ 
> > > > The indicated Home Inputs are just recommendations.ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > ÃÆ'‚ 
> > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'‚  Maybe you have one already?ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > ÃÆ'‚ 
> > > > Regards
> > > > TK
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Monday, June 20, 2011, 4:08 AM
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > >
> > > > Hi TK,
> > > >
> > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > Next question is the limit switches.
> > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > >
> > > > Thanks for your help we are getting there.
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > Did you read the links I sent?ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything directly.ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > Regards
> > > > > TK
> > > > >
> > > > >
> > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > >
> > > > >
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi TK,
> > > > >
> > > > > Thanks for thr quick reply,
> > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > Thanks for your quick response.
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ function callÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ such asÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > > >
> > > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > HTH
> > > > > > TK
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi All,
> > > > > >
> > > > > > Im new to the Kflop board just got it out today for play.
> > > > > > I have managed to install the software and wire up a stepper motor.
> > > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > John
> > > > > >
> > > > >
> > > >
> > >
> >
>

  @@attachment@@
Group: DynoMotion Message: 1359 From: jonny1bar Date: 6/24/2011
Subject: Re: Newbe needs help
Hi Tom

Ok I will try to work it out

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> See Attached
>  
> Software is very expensive :}
>  
> TK
>
> --- On Fri, 6/24/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Friday, June 24, 2011, 1:17 PM
>
>
>  
>
>
>
>
> Hi Tom
>
> Yes I use 1 switch for homeing and limit on each axis.
> Could you compile a c program for me to get the limit switches working so I can see what you have done.
> I am new to all this and need all the help I can get.
> I know of people that can help me but not sure how much it will cost.
> Thanks
>
> John
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > The error is because you have a line of code to restore the Limit Switch Options but you never saved the options and a location to save them was never declared. 
> >  
> > Are you using the same switch for homing and a limit?  If you are then you need to:
> >
> > #1 declare a place to save the original settings
> >     Add an integer variable (inside the main function just after the bracket) with
> >  
> >     int SaveZLimits;
> >  
> >  
> > #2 save them before homing
> >  
> >    SaveZLimits = ch2->LimitSwitchOptions; // save original limit settings
> >
> > #3 disable the limits
> >  
> > ch2->LimitSwitchOptions = 0;  // disable limits
> >  
> >  
> > #4 restore them (after homing)
> >  
> > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> >
> >  
> >  
> > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> >  
> >  
> > Regards
> > TK
> >  
> >
> >
> > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Thursday, June 23, 2011, 10:43 AM
> >
> >
> >  
> >
> >
> >
> > Hi Tom,
> >
> > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > If it works can i try it through mach3.
> > I have just worked out you can run the program from the c screen.
> > Were so close I can taste it.
> >
> > Thanks
> >
> > John
> >
> > #include "KMotionDef.h"
> >
> > // Configuration and Homing program for a 3 axis System
> > // Limit switches are disabled and used as a home switch
> > // then they are re-enabled
> >
> > main()
> > {
> >
> >
> > // enable all 3 axes and begin servoing where we are
> >
> > EnableAxis(0);
> > EnableAxis(1);
> > EnableAxis(2);
> >
> > // Home Z up first - jog until it sees the limit
> >
> > Jog(2,100); // jog slowly positive
> > while (!ReadBit(10)) ; // loop until IO bit goes high
> > Jog(2,0); // stop
> > while (!CheckDone(2)) ; // loop until motion completes
> > DisableAxis(2); // disable the axis
> > Zero(2); // Zero the position
> > EnableAxis(2); // re-enable the ServoTick
> > Move(2,-1000.0); // move some amount inside the limits
> > while (!CheckDone(2)) ; // loop until motion completes
> > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> >
> > // Home X next - jog until it sees the limit
> >
> > Jog(0,-100); // jog slowly negative
> > while (!ReadBit(10)) ; // loop until IO bit goes high
> > Jog(0,0); // stop
> > while (!CheckDone(0)) ; // loop until motion completes
> > DisableAxis(0); // disable the axis
> > Zero(0); // Zero the position
> > EnableAxis(0); // re-enable the ServoTick
> > Move(0,1000.0); // move some amount inside the limits
> > while (!CheckDone(0)) ; // loop until motion completes
> > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> >
> > // Home Y next - jog until it sees the limit
> >
> > Jog(1,-100); // jog slowly negative
> > while (!ReadBit(9)) ; // loop until IO bit goes high
> > Jog(1,0); // stop
> > while (!CheckDone(1)) ; // loop until motion completes
> > DisableAxis(1); // disable the axis
> > Zero(1); // Zero the position
> > EnableAxis(1); // re-enable the ServoTick
> > Move(1,1000.0); // move some amount inside the limits
> > while (!CheckDone(1)) ; // loop until motion completes
> > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> >
> > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > }
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > The code looks reasonable to me.  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > >  
> > > For Mach3 each axis is homed separately.  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > >  
> > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > >  
> > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.  Which is the Jog, wait for switch, stop.  See if that works.
> > >  
> > > Regards,
> > > TK
> > >
> > >
> > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Wednesday, June 22, 2011, 11:05 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi Tom,
> > >
> > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > >
> > > Can you also have a quick look at axis C code
> > >
> > > #include "KMotionDef.h"
> > >
> > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > // enables them
> > > // sets them as an xyz coordinate system for GCode
> > >
> > > int main()
> > > {
> > > ch0->InputMode=NO_INPUT_MODE;
> > > ch0->OutputMode=STEP_DIR_MODE;
> > > ch0->Vel=40000;
> > > ch0->Accel=400000;
> > > ch0->Jerk=4000000;
> > > ch0->P=0;
> > > ch0->I=0.009999999776483;
> > > ch0->D=0;
> > > ch0->FFAccel=0;
> > > ch0->FFVel=0;
> > > ch0->MaxI=200;
> > > ch0->MaxErr=1000000;
> > > ch0->MaxOutput=200;
> > > ch0->DeadBandGain=1;
> > > ch0->DeadBandRange=0;
> > > ch0->InputChan0=2;
> > > ch0->InputChan1=0;
> > > ch0->OutputChan0=2;
> > > ch0->OutputChan1=0;
> > > ch0->MasterAxis=-1;
> > > ch0->LimitSwitchOptions=0x0;
> > > ch0->InputGain0=1;
> > > ch0->InputGain1=1;
> > > ch0->InputOffset0=0;
> > > ch0->InputOffset1=0;
> > > ch0->OutputGain=1;
> > > ch0->OutputOffset=0;
> > > ch0->SlaveGain=1;
> > > ch0->BacklashMode=BACKLASH_OFF;
> > > ch0->BacklashAmount=0;
> > > ch0->BacklashRate=0;
> > > ch0->invDistPerCycle=1;
> > > ch0->Lead=0;
> > > ch0->MaxFollowingError=1000000000;
> > > ch0->StepperAmplitude=20;
> > >
> > > ch0->iir[0].B0=1;
> > > ch0->iir[0].B1=0;
> > > ch0->iir[0].B2=0;
> > > ch0->iir[0].A1=0;
> > > ch0->iir[0].A2=0;
> > >
> > > ch0->iir[1].B0=1;
> > > ch0->iir[1].B1=0;
> > > ch0->iir[1].B2=0;
> > > ch0->iir[1].A1=0;
> > > ch0->iir[1].A2=0;
> > >
> > > ch0->iir[2].B0=0.0007689999765716;
> > > ch0->iir[2].B1=0.001537999953143;
> > > ch0->iir[2].B2=0.0007689999765716;
> > > ch0->iir[2].A1=1.920809984207;
> > > ch0->iir[2].A2=-0.9238849878311;
> > > EnableAxisDest(0,0);
> > >
> > > ch1->InputMode=NO_INPUT_MODE;
> > > ch1->OutputMode=STEP_DIR_MODE;
> > > ch1->Vel=40000;
> > > ch1->Accel=400000;
> > > ch1->Jerk=4000000;
> > > ch1->P=0;
> > > ch1->I=0.009999999776483;
> > > ch1->D=0;
> > > ch1->FFAccel=0;
> > > ch1->FFVel=0;
> > > ch1->MaxI=200;
> > > ch1->MaxErr=1000000;
> > > ch1->MaxOutput=200;
> > > ch1->DeadBandGain=1;
> > > ch1->DeadBandRange=0;
> > > ch1->InputChan0=2;
> > > ch1->InputChan1=0;
> > > ch1->OutputChan0=2;
> > > ch1->OutputChan1=0;
> > > ch1->MasterAxis=-1;
> > > ch1->LimitSwitchOptions=0x0;
> > > ch1->InputGain0=1;
> > > ch1->InputGain1=1;
> > > ch1->InputOffset0=0;
> > > ch1->InputOffset1=0;
> > > ch1->OutputGain=1;
> > > ch1->OutputOffset=0;
> > > ch1->SlaveGain=1;
> > > ch1->BacklashMode=BACKLASH_OFF;
> > > ch1->BacklashAmount=0;
> > > ch1->BacklashRate=0;
> > > ch1->invDistPerCycle=1;
> > > ch1->Lead=0;
> > > ch1->MaxFollowingError=1000000000;
> > > ch1->StepperAmplitude=20;
> > >
> > > ch1->iir[0].B0=1;
> > > ch1->iir[0].B1=0;
> > > ch1->iir[0].B2=0;
> > > ch1->iir[0].A1=0;
> > > ch1->iir[0].A2=0;
> > >
> > > ch1->iir[1].B0=1;
> > > ch1->iir[1].B1=0;
> > > ch1->iir[1].B2=0;
> > > ch1->iir[1].A1=0;
> > > ch1->iir[1].A2=0;
> > >
> > > ch1->iir[2].B0=0.0007689999765716;
> > > ch1->iir[2].B1=0.001537999953143;
> > > ch1->iir[2].B2=0.0007689999765716;
> > > ch1->iir[2].A1=1.920809984207;
> > > ch1->iir[2].A2=-0.9238849878311;
> > > EnableAxisDest(1,0);
> > >
> > > ch2->InputMode=NO_INPUT_MODE;
> > > ch2->OutputMode=STEP_DIR_MODE;
> > > ch2->Vel=40000;
> > > ch2->Accel=400000;
> > > ch2->Jerk=4000000;
> > > ch2->P=0;
> > > ch2->I=0.009999999776483;
> > > ch2->D=0;
> > > ch2->FFAccel=0;
> > > ch2->FFVel=0;
> > > ch2->MaxI=200;
> > > ch2->MaxErr=1000000;
> > > ch2->MaxOutput=200;
> > > ch2->DeadBandGain=1;
> > > ch2->DeadBandRange=0;
> > > ch2->InputChan0=0;
> > > ch2->InputChan1=0;
> > > ch2->OutputChan0=0;
> > > ch2->OutputChan1=0;
> > > ch2->MasterAxis=-1;
> > > ch2->LimitSwitchOptions=0x30015;
> > > ch2->InputGain0=1;
> > > ch2->InputGain1=1;
> > > ch2->InputOffset0=0;
> > > ch2->InputOffset1=0;
> > > ch2->OutputGain=1;
> > > ch2->OutputOffset=0;
> > > ch2->SlaveGain=1;
> > > ch2->BacklashMode=BACKLASH_OFF;
> > > ch2->BacklashAmount=0;
> > > ch2->BacklashRate=0;
> > > ch2->invDistPerCycle=1;
> > > ch2->Lead=0;
> > > ch2->MaxFollowingError=1000000000;
> > > ch2->StepperAmplitude=20;
> > >
> > > ch2->iir[0].B0=1;
> > > ch2->iir[0].B1=0;
> > > ch2->iir[0].B2=0;
> > > ch2->iir[0].A1=0;
> > > ch2->iir[0].A2=0;
> > >
> > > ch2->iir[1].B0=1;
> > > ch2->iir[1].B1=0;
> > > ch2->iir[1].B2=0;
> > > ch2->iir[1].A1=0;
> > > ch2->iir[1].A2=0;
> > >
> > > ch2->iir[2].B0=0.0007689999765716;
> > > ch2->iir[2].B1=0.001537999953143;
> > > ch2->iir[2].B2=0.0007689999765716;
> > > ch2->iir[2].A1=1.920809984207;
> > > ch2->iir[2].A2=-0.9238849878311;
> > > EnableAxisDest(2,0);
> > >
> > > DefineCoordSystem(0,1,2,-1);
> > >
> > > return 0;
> > > }
> > >
> > > And this is the one for the home switches.
> > >
> > > #include "KMotionDef.h"
> > >
> > > // Configuration and Homing program for a 3 axis System
> > > // Limit switches are disabled and used as a home switch
> > > // then they are re-enabled
> > >
> > > main()
> > > {
> > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > >
> > > DisableAxis(0); // Disable all axes
> > > DisableAxis(1);
> > > DisableAxis(2);
> > >
> > > // Set the axis parameters here
> > > // after everything is configured in the KMotion Screens
> > > // use copy C Code to clipboard on the configuration screen
> > > // then paste here. Repeat for each axis
> > >
> > > ch0->InputMode=NO_INPUT_MODE;
> > > ch0->OutputMode=STEP_DIR_MODE;
> > > ch0->Vel=40000;
> > > ch0->Accel=400000;
> > > ch0->Jerk=4000000;
> > > ch0->P=0;
> > > ch0->I=0.009999999776483;
> > > ch0->D=0;
> > > ch0->FFAccel=0;
> > > ch0->FFVel=0;
> > > ch0->MaxI=200;
> > > ch0->MaxErr=1000000;
> > > ch0->MaxOutput=200;
> > > ch0->DeadBandGain=1;
> > > ch0->DeadBandRange=0;
> > > ch0->InputChan0=2;
> > > ch0->InputChan1=0;
> > > ch0->OutputChan0=2;
> > > ch0->OutputChan1=0;
> > > ch0->MasterAxis=-1;
> > > ch0->LimitSwitchOptions=0x0;
> > > ch0->InputGain0=1;
> > > ch0->InputGain1=1;
> > > ch0->InputOffset0=0;
> > > ch0->InputOffset1=0;
> > > ch0->OutputGain=1;
> > > ch0->OutputOffset=0;
> > > ch0->SlaveGain=1;
> > > ch0->BacklashMode=BACKLASH_OFF;
> > > ch0->BacklashAmount=0;
> > > ch0->BacklashRate=0;
> > > ch0->invDistPerCycle=1;
> > > ch0->Lead=0;
> > > ch0->MaxFollowingError=1000000000;
> > > ch0->StepperAmplitude=20;
> > >
> > > ch0->iir[0].B0=1;
> > > ch0->iir[0].B1=0;
> > > ch0->iir[0].B2=0;
> > > ch0->iir[0].A1=0;
> > > ch0->iir[0].A2=0;
> > >
> > > ch0->iir[1].B0=1;
> > > ch0->iir[1].B1=0;
> > > ch0->iir[1].B2=0;
> > > ch0->iir[1].A1=0;
> > > ch0->iir[1].A2=0;
> > >
> > > ch0->iir[2].B0=0.0007689999765716;
> > > ch0->iir[2].B1=0.001537999953143;
> > > ch0->iir[2].B2=0.0007689999765716;
> > > ch0->iir[2].A1=1.920809984207;
> > > ch0->iir[2].A2=-0.9238849878311;
> > >
> > > ch1->InputMode=NO_INPUT_MODE;
> > > ch1->OutputMode=STEP_DIR_MODE;
> > > ch1->Vel=40000;
> > > ch1->Accel=400000;
> > > ch1->Jerk=4000000;
> > > ch1->P=0;
> > > ch1->I=0.009999999776483;
> > > ch1->D=0;
> > > ch1->FFAccel=0;
> > > ch1->FFVel=0;
> > > ch1->MaxI=200;
> > > ch1->MaxErr=1000000;
> > > ch1->MaxOutput=200;
> > > ch1->DeadBandGain=1;
> > > ch1->DeadBandRange=0;
> > > ch1->InputChan0=2;
> > > ch1->InputChan1=0;
> > > ch1->OutputChan0=2;
> > > ch1->OutputChan1=0;
> > > ch1->MasterAxis=-1;
> > > ch1->LimitSwitchOptions=0x0;
> > > ch1->InputGain0=1;
> > > ch1->InputGain1=1;
> > > ch1->InputOffset0=0;
> > > ch1->InputOffset1=0;
> > > ch1->OutputGain=1;
> > > ch1->OutputOffset=0;
> > > ch1->SlaveGain=1;
> > > ch1->BacklashMode=BACKLASH_OFF;
> > > ch1->BacklashAmount=0;
> > > ch1->BacklashRate=0;
> > > ch1->invDistPerCycle=1;
> > > ch1->Lead=0;
> > > ch1->MaxFollowingError=1000000000;
> > > ch1->StepperAmplitude=20;
> > >
> > > ch1->iir[0].B0=1;
> > > ch1->iir[0].B1=0;
> > > ch1->iir[0].B2=0;
> > > ch1->iir[0].A1=0;
> > > ch1->iir[0].A2=0;
> > >
> > > ch1->iir[1].B0=1;
> > > ch1->iir[1].B1=0;
> > > ch1->iir[1].B2=0;
> > > ch1->iir[1].A1=0;
> > > ch1->iir[1].A2=0;
> > >
> > > ch1->iir[2].B0=0.0007689999765716;
> > > ch1->iir[2].B1=0.001537999953143;
> > > ch1->iir[2].B2=0.0007689999765716;
> > > ch1->iir[2].A1=1.920809984207;
> > > ch1->iir[2].A2=-0.9238849878311;
> > >
> > > ch2->InputMode=NO_INPUT_MODE;
> > > ch2->OutputMode=STEP_DIR_MODE;
> > > ch2->Vel=40000;
> > > ch2->Accel=400000;
> > > ch2->Jerk=4000000;
> > > ch2->P=0;
> > > ch2->I=0.009999999776483;
> > > ch2->D=0;
> > > ch2->FFAccel=0;
> > > ch2->FFVel=0;
> > > ch2->MaxI=200;
> > > ch2->MaxErr=1000000;
> > > ch2->MaxOutput=200;
> > > ch2->DeadBandGain=1;
> > > ch2->DeadBandRange=0;
> > > ch2->InputChan0=0;
> > > ch2->InputChan1=0;
> > > ch2->OutputChan0=0;
> > > ch2->OutputChan1=0;
> > > ch2->MasterAxis=-1;
> > > ch2->LimitSwitchOptions=0x30015;
> > > ch2->InputGain0=1;
> > > ch2->InputGain1=1;
> > > ch2->InputOffset0=0;
> > > ch2->InputOffset1=0;
> > > ch2->OutputGain=1;
> > > ch2->OutputOffset=0;
> > > ch2->SlaveGain=1;
> > > ch2->BacklashMode=BACKLASH_OFF;
> > > ch2->BacklashAmount=0;
> > > ch2->BacklashRate=0;
> > > ch2->invDistPerCycle=1;
> > > ch2->Lead=0;
> > > ch2->MaxFollowingError=1000000000;
> > > ch2->StepperAmplitude=20;
> > >
> > > ch2->iir[0].B0=1;
> > > ch2->iir[0].B1=0;
> > > ch2->iir[0].B2=0;
> > > ch2->iir[0].A1=0;
> > > ch2->iir[0].A2=0;
> > >
> > > ch2->iir[1].B0=1;
> > > ch2->iir[1].B1=0;
> > > ch2->iir[1].B2=0;
> > > ch2->iir[1].A1=0;
> > > ch2->iir[1].A2=0;
> > >
> > > ch2->iir[2].B0=0.0007689999765716;
> > > ch2->iir[2].B1=0.001537999953143;
> > > ch2->iir[2].B2=0.0007689999765716;
> > > ch2->iir[2].A1=1.920809984207;
> > > ch2->iir[2].A2=-0.9238849878311;
> > >
> > >
> > >
> > >
> > >
> > > // disable the limits (first save how they were set)
> > > SaveXLimits = ch0->LimitSwitchOptions;
> > > SaveYLimits = ch1->LimitSwitchOptions;
> > > SaveZLimits = ch2->LimitSwitchOptions;
> > > ch0->LimitSwitchOptions = 0;
> > > ch1->LimitSwitchOptions = 0;
> > > ch2->LimitSwitchOptions = 0;
> > >
> > > // enable all 3 axes and begin servoing where we are
> > >
> > > EnableAxis(0);
> > > EnableAxis(1);
> > > EnableAxis(2);
> > >
> > > // Home Z up first - jog until it sees the limit
> > >
> > > Jog(2,100); // jog slowly positive
> > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > Jog(2,0); // stop
> > > while (!CheckDone(2)) ; // loop until motion completes
> > > DisableAxis(2); // disable the axis
> > > Zero(2); // Zero the position
> > > EnableAxis(2); // re-enable the ServoTick
> > > Move(2,-1000.0); // move some amount inside the limits
> > > while (!CheckDone(2)) ; // loop until motion completes
> > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > >
> > > // Home X next - jog until it sees the limit
> > >
> > > Jog(0,-100); // jog slowly negative
> > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > Jog(0,0); // stop
> > > while (!CheckDone(0)) ; // loop until motion completes
> > > DisableAxis(0); // disable the axis
> > > Zero(0); // Zero the position
> > > EnableAxis(0); // re-enable the ServoTick
> > > Move(0,1000.0); // move some amount inside the limits
> > > while (!CheckDone(0)) ; // loop until motion completes
> > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > >
> > > // Home Y next - jog until it sees the limit
> > >
> > > Jog(1,-100); // jog slowly negative
> > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > Jog(1,0); // stop
> > > while (!CheckDone(1)) ; // loop until motion completes
> > > DisableAxis(1); // disable the axis
> > > Zero(1); // Zero the position
> > > EnableAxis(1); // re-enable the ServoTick
> > > Move(1,1000.0); // move some amount inside the limits
> > > while (!CheckDone(1)) ; // loop until motion completes
> > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > >
> > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > }
> > >
> > > Thanks for all your help
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > > ÃÆ'‚ 
> > > > Let's see:ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'‚ xÃÆ'‚  1mm /ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > ÃÆ'‚ 
> > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'‚ 
> > > >
> > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'‚ 
> > > > ÃÆ'‚ 
> > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'‚  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > ÃÆ'‚ 
> > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > ÃÆ'‚ 
> > > > Regards
> > > > TK
> > > > ÃÆ'‚ 
> > > >
> > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Monday, June 20, 2011, 2:13 PM
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > >
> > > > Hi TK
> > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > What is the max I can run?(I'm a speed demon)
> > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > Thanks again
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Hi John,
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > That's good progress.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one already?ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > Regards
> > > > > TK
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > >
> > > > >
> > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Monday, June 20, 2011, 4:08 AM
> > > > >
> > > > >
> > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi TK,
> > > > >
> > > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > > Next question is the limit switches.
> > > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > > >
> > > > > Thanks for your help we are getting there.
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Did you read the links I sent?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything directly.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Regards
> > > > > > TK
> > > > > >
> > > > > >
> > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi TK,
> > > > > >
> > > > > > Thanks for thr quick reply,
> > > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > > Thanks for your quick response.
> > > > > >
> > > > > > John
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ function callÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ such asÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > > > >
> > > > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > HTH
> > > > > > > TK
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi All,
> > > > > > >
> > > > > > > Im new to the Kflop board just got it out today for play.
> > > > > > > I have managed to install the software and wire up a stepper motor.
> > > > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 1361 From: jonny1bar Date: 6/25/2011
Subject: Re: Newbe needs help
Hi Tom,

Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
What is the best way to sort this.
Could we set the loop until IO bit goes high to low somehow.
Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.

Thanks

John

--- In DynoMotion@yahoogroups.com, "jonny1bar" <john@...> wrote:
>
> Hi Tom
>
> Ok I will try to work it out
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > See Attached
> >  
> > Software is very expensive :}
> >  
> > TK
> >
> > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Friday, June 24, 2011, 1:17 PM
> >
> >
> >  
> >
> >
> >
> >
> > Hi Tom
> >
> > Yes I use 1 switch for homeing and limit on each axis.
> > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > I am new to all this and need all the help I can get.
> > I know of people that can help me but not sure how much it will cost.
> > Thanks
> >
> > John
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > The error is because you have a line of code to restore the Limit Switch Options but you never saved the options and a location to save them was never declared. 
> > >  
> > > Are you using the same switch for homing and a limit?  If you are then you need to:
> > >
> > > #1 declare a place to save the original settings
> > >     Add an integer variable (inside the main function just after the bracket) with
> > >  
> > >     int SaveZLimits;
> > >  
> > >  
> > > #2 save them before homing
> > >  
> > >    SaveZLimits = ch2->LimitSwitchOptions; // save original limit settings
> > >
> > > #3 disable the limits
> > >  
> > > ch2->LimitSwitchOptions = 0;  // disable limits
> > >  
> > >  
> > > #4 restore them (after homing)
> > >  
> > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > >
> > >  
> > >  
> > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > >  
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > >
> > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Thursday, June 23, 2011, 10:43 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi Tom,
> > >
> > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > If it works can i try it through mach3.
> > > I have just worked out you can run the program from the c screen.
> > > Were so close I can taste it.
> > >
> > > Thanks
> > >
> > > John
> > >
> > > #include "KMotionDef.h"
> > >
> > > // Configuration and Homing program for a 3 axis System
> > > // Limit switches are disabled and used as a home switch
> > > // then they are re-enabled
> > >
> > > main()
> > > {
> > >
> > >
> > > // enable all 3 axes and begin servoing where we are
> > >
> > > EnableAxis(0);
> > > EnableAxis(1);
> > > EnableAxis(2);
> > >
> > > // Home Z up first - jog until it sees the limit
> > >
> > > Jog(2,100); // jog slowly positive
> > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > Jog(2,0); // stop
> > > while (!CheckDone(2)) ; // loop until motion completes
> > > DisableAxis(2); // disable the axis
> > > Zero(2); // Zero the position
> > > EnableAxis(2); // re-enable the ServoTick
> > > Move(2,-1000.0); // move some amount inside the limits
> > > while (!CheckDone(2)) ; // loop until motion completes
> > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > >
> > > // Home X next - jog until it sees the limit
> > >
> > > Jog(0,-100); // jog slowly negative
> > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > Jog(0,0); // stop
> > > while (!CheckDone(0)) ; // loop until motion completes
> > > DisableAxis(0); // disable the axis
> > > Zero(0); // Zero the position
> > > EnableAxis(0); // re-enable the ServoTick
> > > Move(0,1000.0); // move some amount inside the limits
> > > while (!CheckDone(0)) ; // loop until motion completes
> > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > >
> > > // Home Y next - jog until it sees the limit
> > >
> > > Jog(1,-100); // jog slowly negative
> > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > Jog(1,0); // stop
> > > while (!CheckDone(1)) ; // loop until motion completes
> > > DisableAxis(1); // disable the axis
> > > Zero(1); // Zero the position
> > > EnableAxis(1); // re-enable the ServoTick
> > > Move(1,1000.0); // move some amount inside the limits
> > > while (!CheckDone(1)) ; // loop until motion completes
> > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > >
> > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > }
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > >  
> > > > The code looks reasonable to me.  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > >  
> > > > For Mach3 each axis is homed separately.  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > >  
> > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > >  
> > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.  Which is the Jog, wait for switch, stop.  See if that works.
> > > >  
> > > > Regards,
> > > > TK
> > > >
> > > >
> > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > >
> > > >
> > > >  
> > > >
> > > >
> > > >
> > > > Hi Tom,
> > > >
> > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > >
> > > > Can you also have a quick look at axis C code
> > > >
> > > > #include "KMotionDef.h"
> > > >
> > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > // enables them
> > > > // sets them as an xyz coordinate system for GCode
> > > >
> > > > int main()
> > > > {
> > > > ch0->InputMode=NO_INPUT_MODE;
> > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > ch0->Vel=40000;
> > > > ch0->Accel=400000;
> > > > ch0->Jerk=4000000;
> > > > ch0->P=0;
> > > > ch0->I=0.009999999776483;
> > > > ch0->D=0;
> > > > ch0->FFAccel=0;
> > > > ch0->FFVel=0;
> > > > ch0->MaxI=200;
> > > > ch0->MaxErr=1000000;
> > > > ch0->MaxOutput=200;
> > > > ch0->DeadBandGain=1;
> > > > ch0->DeadBandRange=0;
> > > > ch0->InputChan0=2;
> > > > ch0->InputChan1=0;
> > > > ch0->OutputChan0=2;
> > > > ch0->OutputChan1=0;
> > > > ch0->MasterAxis=-1;
> > > > ch0->LimitSwitchOptions=0x0;
> > > > ch0->InputGain0=1;
> > > > ch0->InputGain1=1;
> > > > ch0->InputOffset0=0;
> > > > ch0->InputOffset1=0;
> > > > ch0->OutputGain=1;
> > > > ch0->OutputOffset=0;
> > > > ch0->SlaveGain=1;
> > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > ch0->BacklashAmount=0;
> > > > ch0->BacklashRate=0;
> > > > ch0->invDistPerCycle=1;
> > > > ch0->Lead=0;
> > > > ch0->MaxFollowingError=1000000000;
> > > > ch0->StepperAmplitude=20;
> > > >
> > > > ch0->iir[0].B0=1;
> > > > ch0->iir[0].B1=0;
> > > > ch0->iir[0].B2=0;
> > > > ch0->iir[0].A1=0;
> > > > ch0->iir[0].A2=0;
> > > >
> > > > ch0->iir[1].B0=1;
> > > > ch0->iir[1].B1=0;
> > > > ch0->iir[1].B2=0;
> > > > ch0->iir[1].A1=0;
> > > > ch0->iir[1].A2=0;
> > > >
> > > > ch0->iir[2].B0=0.0007689999765716;
> > > > ch0->iir[2].B1=0.001537999953143;
> > > > ch0->iir[2].B2=0.0007689999765716;
> > > > ch0->iir[2].A1=1.920809984207;
> > > > ch0->iir[2].A2=-0.9238849878311;
> > > > EnableAxisDest(0,0);
> > > >
> > > > ch1->InputMode=NO_INPUT_MODE;
> > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > ch1->Vel=40000;
> > > > ch1->Accel=400000;
> > > > ch1->Jerk=4000000;
> > > > ch1->P=0;
> > > > ch1->I=0.009999999776483;
> > > > ch1->D=0;
> > > > ch1->FFAccel=0;
> > > > ch1->FFVel=0;
> > > > ch1->MaxI=200;
> > > > ch1->MaxErr=1000000;
> > > > ch1->MaxOutput=200;
> > > > ch1->DeadBandGain=1;
> > > > ch1->DeadBandRange=0;
> > > > ch1->InputChan0=2;
> > > > ch1->InputChan1=0;
> > > > ch1->OutputChan0=2;
> > > > ch1->OutputChan1=0;
> > > > ch1->MasterAxis=-1;
> > > > ch1->LimitSwitchOptions=0x0;
> > > > ch1->InputGain0=1;
> > > > ch1->InputGain1=1;
> > > > ch1->InputOffset0=0;
> > > > ch1->InputOffset1=0;
> > > > ch1->OutputGain=1;
> > > > ch1->OutputOffset=0;
> > > > ch1->SlaveGain=1;
> > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > ch1->BacklashAmount=0;
> > > > ch1->BacklashRate=0;
> > > > ch1->invDistPerCycle=1;
> > > > ch1->Lead=0;
> > > > ch1->MaxFollowingError=1000000000;
> > > > ch1->StepperAmplitude=20;
> > > >
> > > > ch1->iir[0].B0=1;
> > > > ch1->iir[0].B1=0;
> > > > ch1->iir[0].B2=0;
> > > > ch1->iir[0].A1=0;
> > > > ch1->iir[0].A2=0;
> > > >
> > > > ch1->iir[1].B0=1;
> > > > ch1->iir[1].B1=0;
> > > > ch1->iir[1].B2=0;
> > > > ch1->iir[1].A1=0;
> > > > ch1->iir[1].A2=0;
> > > >
> > > > ch1->iir[2].B0=0.0007689999765716;
> > > > ch1->iir[2].B1=0.001537999953143;
> > > > ch1->iir[2].B2=0.0007689999765716;
> > > > ch1->iir[2].A1=1.920809984207;
> > > > ch1->iir[2].A2=-0.9238849878311;
> > > > EnableAxisDest(1,0);
> > > >
> > > > ch2->InputMode=NO_INPUT_MODE;
> > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > ch2->Vel=40000;
> > > > ch2->Accel=400000;
> > > > ch2->Jerk=4000000;
> > > > ch2->P=0;
> > > > ch2->I=0.009999999776483;
> > > > ch2->D=0;
> > > > ch2->FFAccel=0;
> > > > ch2->FFVel=0;
> > > > ch2->MaxI=200;
> > > > ch2->MaxErr=1000000;
> > > > ch2->MaxOutput=200;
> > > > ch2->DeadBandGain=1;
> > > > ch2->DeadBandRange=0;
> > > > ch2->InputChan0=0;
> > > > ch2->InputChan1=0;
> > > > ch2->OutputChan0=0;
> > > > ch2->OutputChan1=0;
> > > > ch2->MasterAxis=-1;
> > > > ch2->LimitSwitchOptions=0x30015;
> > > > ch2->InputGain0=1;
> > > > ch2->InputGain1=1;
> > > > ch2->InputOffset0=0;
> > > > ch2->InputOffset1=0;
> > > > ch2->OutputGain=1;
> > > > ch2->OutputOffset=0;
> > > > ch2->SlaveGain=1;
> > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > ch2->BacklashAmount=0;
> > > > ch2->BacklashRate=0;
> > > > ch2->invDistPerCycle=1;
> > > > ch2->Lead=0;
> > > > ch2->MaxFollowingError=1000000000;
> > > > ch2->StepperAmplitude=20;
> > > >
> > > > ch2->iir[0].B0=1;
> > > > ch2->iir[0].B1=0;
> > > > ch2->iir[0].B2=0;
> > > > ch2->iir[0].A1=0;
> > > > ch2->iir[0].A2=0;
> > > >
> > > > ch2->iir[1].B0=1;
> > > > ch2->iir[1].B1=0;
> > > > ch2->iir[1].B2=0;
> > > > ch2->iir[1].A1=0;
> > > > ch2->iir[1].A2=0;
> > > >
> > > > ch2->iir[2].B0=0.0007689999765716;
> > > > ch2->iir[2].B1=0.001537999953143;
> > > > ch2->iir[2].B2=0.0007689999765716;
> > > > ch2->iir[2].A1=1.920809984207;
> > > > ch2->iir[2].A2=-0.9238849878311;
> > > > EnableAxisDest(2,0);
> > > >
> > > > DefineCoordSystem(0,1,2,-1);
> > > >
> > > > return 0;
> > > > }
> > > >
> > > > And this is the one for the home switches.
> > > >
> > > > #include "KMotionDef.h"
> > > >
> > > > // Configuration and Homing program for a 3 axis System
> > > > // Limit switches are disabled and used as a home switch
> > > > // then they are re-enabled
> > > >
> > > > main()
> > > > {
> > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > >
> > > > DisableAxis(0); // Disable all axes
> > > > DisableAxis(1);
> > > > DisableAxis(2);
> > > >
> > > > // Set the axis parameters here
> > > > // after everything is configured in the KMotion Screens
> > > > // use copy C Code to clipboard on the configuration screen
> > > > // then paste here. Repeat for each axis
> > > >
> > > > ch0->InputMode=NO_INPUT_MODE;
> > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > ch0->Vel=40000;
> > > > ch0->Accel=400000;
> > > > ch0->Jerk=4000000;
> > > > ch0->P=0;
> > > > ch0->I=0.009999999776483;
> > > > ch0->D=0;
> > > > ch0->FFAccel=0;
> > > > ch0->FFVel=0;
> > > > ch0->MaxI=200;
> > > > ch0->MaxErr=1000000;
> > > > ch0->MaxOutput=200;
> > > > ch0->DeadBandGain=1;
> > > > ch0->DeadBandRange=0;
> > > > ch0->InputChan0=2;
> > > > ch0->InputChan1=0;
> > > > ch0->OutputChan0=2;
> > > > ch0->OutputChan1=0;
> > > > ch0->MasterAxis=-1;
> > > > ch0->LimitSwitchOptions=0x0;
> > > > ch0->InputGain0=1;
> > > > ch0->InputGain1=1;
> > > > ch0->InputOffset0=0;
> > > > ch0->InputOffset1=0;
> > > > ch0->OutputGain=1;
> > > > ch0->OutputOffset=0;
> > > > ch0->SlaveGain=1;
> > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > ch0->BacklashAmount=0;
> > > > ch0->BacklashRate=0;
> > > > ch0->invDistPerCycle=1;
> > > > ch0->Lead=0;
> > > > ch0->MaxFollowingError=1000000000;
> > > > ch0->StepperAmplitude=20;
> > > >
> > > > ch0->iir[0].B0=1;
> > > > ch0->iir[0].B1=0;
> > > > ch0->iir[0].B2=0;
> > > > ch0->iir[0].A1=0;
> > > > ch0->iir[0].A2=0;
> > > >
> > > > ch0->iir[1].B0=1;
> > > > ch0->iir[1].B1=0;
> > > > ch0->iir[1].B2=0;
> > > > ch0->iir[1].A1=0;
> > > > ch0->iir[1].A2=0;
> > > >
> > > > ch0->iir[2].B0=0.0007689999765716;
> > > > ch0->iir[2].B1=0.001537999953143;
> > > > ch0->iir[2].B2=0.0007689999765716;
> > > > ch0->iir[2].A1=1.920809984207;
> > > > ch0->iir[2].A2=-0.9238849878311;
> > > >
> > > > ch1->InputMode=NO_INPUT_MODE;
> > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > ch1->Vel=40000;
> > > > ch1->Accel=400000;
> > > > ch1->Jerk=4000000;
> > > > ch1->P=0;
> > > > ch1->I=0.009999999776483;
> > > > ch1->D=0;
> > > > ch1->FFAccel=0;
> > > > ch1->FFVel=0;
> > > > ch1->MaxI=200;
> > > > ch1->MaxErr=1000000;
> > > > ch1->MaxOutput=200;
> > > > ch1->DeadBandGain=1;
> > > > ch1->DeadBandRange=0;
> > > > ch1->InputChan0=2;
> > > > ch1->InputChan1=0;
> > > > ch1->OutputChan0=2;
> > > > ch1->OutputChan1=0;
> > > > ch1->MasterAxis=-1;
> > > > ch1->LimitSwitchOptions=0x0;
> > > > ch1->InputGain0=1;
> > > > ch1->InputGain1=1;
> > > > ch1->InputOffset0=0;
> > > > ch1->InputOffset1=0;
> > > > ch1->OutputGain=1;
> > > > ch1->OutputOffset=0;
> > > > ch1->SlaveGain=1;
> > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > ch1->BacklashAmount=0;
> > > > ch1->BacklashRate=0;
> > > > ch1->invDistPerCycle=1;
> > > > ch1->Lead=0;
> > > > ch1->MaxFollowingError=1000000000;
> > > > ch1->StepperAmplitude=20;
> > > >
> > > > ch1->iir[0].B0=1;
> > > > ch1->iir[0].B1=0;
> > > > ch1->iir[0].B2=0;
> > > > ch1->iir[0].A1=0;
> > > > ch1->iir[0].A2=0;
> > > >
> > > > ch1->iir[1].B0=1;
> > > > ch1->iir[1].B1=0;
> > > > ch1->iir[1].B2=0;
> > > > ch1->iir[1].A1=0;
> > > > ch1->iir[1].A2=0;
> > > >
> > > > ch1->iir[2].B0=0.0007689999765716;
> > > > ch1->iir[2].B1=0.001537999953143;
> > > > ch1->iir[2].B2=0.0007689999765716;
> > > > ch1->iir[2].A1=1.920809984207;
> > > > ch1->iir[2].A2=-0.9238849878311;
> > > >
> > > > ch2->InputMode=NO_INPUT_MODE;
> > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > ch2->Vel=40000;
> > > > ch2->Accel=400000;
> > > > ch2->Jerk=4000000;
> > > > ch2->P=0;
> > > > ch2->I=0.009999999776483;
> > > > ch2->D=0;
> > > > ch2->FFAccel=0;
> > > > ch2->FFVel=0;
> > > > ch2->MaxI=200;
> > > > ch2->MaxErr=1000000;
> > > > ch2->MaxOutput=200;
> > > > ch2->DeadBandGain=1;
> > > > ch2->DeadBandRange=0;
> > > > ch2->InputChan0=0;
> > > > ch2->InputChan1=0;
> > > > ch2->OutputChan0=0;
> > > > ch2->OutputChan1=0;
> > > > ch2->MasterAxis=-1;
> > > > ch2->LimitSwitchOptions=0x30015;
> > > > ch2->InputGain0=1;
> > > > ch2->InputGain1=1;
> > > > ch2->InputOffset0=0;
> > > > ch2->InputOffset1=0;
> > > > ch2->OutputGain=1;
> > > > ch2->OutputOffset=0;
> > > > ch2->SlaveGain=1;
> > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > ch2->BacklashAmount=0;
> > > > ch2->BacklashRate=0;
> > > > ch2->invDistPerCycle=1;
> > > > ch2->Lead=0;
> > > > ch2->MaxFollowingError=1000000000;
> > > > ch2->StepperAmplitude=20;
> > > >
> > > > ch2->iir[0].B0=1;
> > > > ch2->iir[0].B1=0;
> > > > ch2->iir[0].B2=0;
> > > > ch2->iir[0].A1=0;
> > > > ch2->iir[0].A2=0;
> > > >
> > > > ch2->iir[1].B0=1;
> > > > ch2->iir[1].B1=0;
> > > > ch2->iir[1].B2=0;
> > > > ch2->iir[1].A1=0;
> > > > ch2->iir[1].A2=0;
> > > >
> > > > ch2->iir[2].B0=0.0007689999765716;
> > > > ch2->iir[2].B1=0.001537999953143;
> > > > ch2->iir[2].B2=0.0007689999765716;
> > > > ch2->iir[2].A1=1.920809984207;
> > > > ch2->iir[2].A2=-0.9238849878311;
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > // disable the limits (first save how they were set)
> > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > ch0->LimitSwitchOptions = 0;
> > > > ch1->LimitSwitchOptions = 0;
> > > > ch2->LimitSwitchOptions = 0;
> > > >
> > > > // enable all 3 axes and begin servoing where we are
> > > >
> > > > EnableAxis(0);
> > > > EnableAxis(1);
> > > > EnableAxis(2);
> > > >
> > > > // Home Z up first - jog until it sees the limit
> > > >
> > > > Jog(2,100); // jog slowly positive
> > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > Jog(2,0); // stop
> > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > DisableAxis(2); // disable the axis
> > > > Zero(2); // Zero the position
> > > > EnableAxis(2); // re-enable the ServoTick
> > > > Move(2,-1000.0); // move some amount inside the limits
> > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > >
> > > > // Home X next - jog until it sees the limit
> > > >
> > > > Jog(0,-100); // jog slowly negative
> > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > Jog(0,0); // stop
> > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > DisableAxis(0); // disable the axis
> > > > Zero(0); // Zero the position
> > > > EnableAxis(0); // re-enable the ServoTick
> > > > Move(0,1000.0); // move some amount inside the limits
> > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > >
> > > > // Home Y next - jog until it sees the limit
> > > >
> > > > Jog(1,-100); // jog slowly negative
> > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > Jog(1,0); // stop
> > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > DisableAxis(1); // disable the axis
> > > > Zero(1); // Zero the position
> > > > EnableAxis(1); // re-enable the ServoTick
> > > > Move(1,1000.0); // move some amount inside the limits
> > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > >
> > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > }
> > > >
> > > > Thanks for all your help
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > > ÃÆ'‚ 
> > > > > Let's see:ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'‚ xÃÆ'‚  1mm /ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > ÃÆ'‚ 
> > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'‚ 
> > > > >
> > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'‚ 
> > > > > ÃÆ'‚ 
> > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'‚  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > ÃÆ'‚ 
> > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > ÃÆ'‚ 
> > > > > Regards
> > > > > TK
> > > > > ÃÆ'‚ 
> > > > >
> > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > >
> > > > >
> > > > > ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi TK
> > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > What is the max I can run?(I'm a speed demon)
> > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > Thanks again
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > That's good progress.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one already?ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Regards
> > > > > > TK
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Monday, June 20, 2011, 4:08 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi TK,
> > > > > >
> > > > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > > > Next question is the limit switches.
> > > > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > > > >
> > > > > > Thanks for your help we are getting there.
> > > > > >
> > > > > > John
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Did you read the links I sent?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything directly.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Regards
> > > > > > > TK
> > > > > > >
> > > > > > >
> > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi TK,
> > > > > > >
> > > > > > > Thanks for thr quick reply,
> > > > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > > > Thanks for your quick response.
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ function callÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ such asÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > > > > >
> > > > > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > HTH
> > > > > > > > TK
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi All,
> > > > > > > >
> > > > > > > > Im new to the Kflop board just got it out today for play.
> > > > > > > > I have managed to install the software and wire up a stepper motor.
> > > > > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 1363 From: Tom Kerekes Date: 6/25/2011
Subject: Re: Newbe needs help
 
 
Hi John,
 
The C language statement
 
while (!ReadBit(10)) ; // loop until IO bit goes high

translated to English would be: loop doing nothing while a read of bit 10 is not true.
 
The " ! " is the NOT operator.  So remove the ! character for a home switch of the opposite polarity.
 
 
Regarding the A Axis disabled.  There was a statement to declare X,Y,Z are used A unused:
 
DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
I removed this statement from your Home Program because it should be in your Init program already.  Is it?  Do you have an Init program?
 
Regards
TK
 

--- On Sat, 6/25/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Saturday, June 25, 2011, 6:50 AM

 
Hi Tom,

Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
What is the best way to sort this.
Could we set the loop until IO bit goes high to low somehow.
Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.

Thanks

John

--- In DynoMotion@yahoogroups.com, "jonny1bar" <john@...> wrote:
>
> Hi Tom
>
> Ok I will try to work it out
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > See Attached
> >  
> > Software is very expensive :}
> >  
> > TK
> >
> > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Friday, June 24, 2011, 1:17 PM
> >
> >
> >  
> >
> >
> >
> >
> > Hi Tom
> >
> > Yes I use 1 switch for homeing and limit on each axis.
> > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > I am new to all this and need all the help I can get.
> > I know of people that can help me but not sure how much it will cost.
> > Thanks
> >
> > John
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > The error is because you have a line of code to restore the Limit Switch Options but you never saved the options and a location to save them was never declared. 
> > >  
> > > Are you using the same switch for homing and a limit?  If you are then you need to:
> > >
> > > #1 declare a place to save the original settings
> > >     Add an integer variable (inside the main function just after the bracket) with
> > >  
> > >     int SaveZLimits;
> > >  
> > >  
> > > #2 save them before homing
> > >  
> > >    SaveZLimits = ch2->LimitSwitchOptions; // save original limit settings
> > >
> > > #3 disable the limits
> > >  
> > > ch2->LimitSwitchOptions = 0;  // disable limits
> > >  
> > >  
> > > #4 restore them (after homing)
> > >  
> > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > >
> > >  
> > >  
> > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > >  
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > >
> > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Thursday, June 23, 2011, 10:43 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi Tom,
> > >
> > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > If it works can i try it through mach3.
> > > I have just worked out you can run the program from the c screen.
> > > Were so close I can taste it.
> > >
> > > Thanks
> > >
> > > John
> > >
> > > #include "KMotionDef.h"
> > >
> > > // Configuration and Homing program for a 3 axis System
> > > // Limit switches are disabled and used as a home switch
> > > // then they are re-enabled
> > >
> > > main()
> > > {
> > >
> > >
> > > // enable all 3 axes and begin servoing where we are
> > >
> > > EnableAxis(0);
> > > EnableAxis(1);
> > > EnableAxis(2);
> > >
> > > // Home Z up first - jog until it sees the limit
> > >
> > > Jog(2,100); // jog slowly positive
> > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > Jog(2,0); // stop
> > > while (!CheckDone(2)) ; // loop until motion completes
> > > DisableAxis(2); // disable the axis
> > > Zero(2); // Zero the position
> > > EnableAxis(2); // re-enable the ServoTick
> > > Move(2,-1000.0); // move some amount inside the limits
> > > while (!CheckDone(2)) ; // loop until motion completes
> > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > >
> > > // Home X next - jog until it sees the limit
> > >
> > > Jog(0,-100); // jog slowly negative
> > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > Jog(0,0); // stop
> > > while (!CheckDone(0)) ; // loop until motion completes
> > > DisableAxis(0); // disable the axis
> > > Zero(0); // Zero the position
> > > EnableAxis(0); // re-enable the ServoTick
> > > Move(0,1000.0); // move some amount inside the limits
> > > while (!CheckDone(0)) ; // loop until motion completes
> > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > >
> > > // Home Y next - jog until it sees the limit
> > >
> > > Jog(1,-100); // jog slowly negative
> > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > Jog(1,0); // stop
> > > while (!CheckDone(1)) ; // loop until motion completes
> > > DisableAxis(1); // disable the axis
> > > Zero(1); // Zero the position
> > > EnableAxis(1); // re-enable the ServoTick
> > > Move(1,1000.0); // move some amount inside the limits
> > > while (!CheckDone(1)) ; // loop until motion completes
> > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > >
> > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > }
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > >  
> > > > The code looks reasonable to me.  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > >  
> > > > For Mach3 each axis is homed separately.  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > >  
> > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > >  
> > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.  Which is the Jog, wait for switch, stop.  See if that works.
> > > >  
> > > > Regards,
> > > > TK
> > > >
> > > >
> > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > >
> > > >
> > > >  
> > > >
> > > >
> > > >
> > > > Hi Tom,
> > > >
> > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > >
> > > > Can you also have a quick look at axis C code
> > > >
> > > > #include "KMotionDef.h"
> > > >
> > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > // enables them
> > > > // sets them as an xyz coordinate system for GCode
> > > >
> > > > int main()
> > > > {
> > > > ch0->InputMode=NO_INPUT_MODE;
> > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > ch0->Vel=40000;
> > > > ch0->Accel=400000;
> > > > ch0->Jerk=4000000;
> > > > ch0->P=0;
> > > > ch0->I=0.009999999776483;
> > > > ch0->D=0;
> > > > ch0->FFAccel=0;
> > > > ch0->FFVel=0;
> > > > ch0->MaxI=200;
> > > > ch0->MaxErr=1000000;
> > > > ch0->MaxOutput=200;
> > > > ch0->DeadBandGain=1;
> > > > ch0->DeadBandRange=0;
> > > > ch0->InputChan0=2;
> > > > ch0->InputChan1=0;
> > > > ch0->OutputChan0=2;
> > > > ch0->OutputChan1=0;
> > > > ch0->MasterAxis=-1;
> > > > ch0->LimitSwitchOptions=0x0;
> > > > ch0->InputGain0=1;
> > > > ch0->InputGain1=1;
> > > > ch0->InputOffset0=0;
> > > > ch0->InputOffset1=0;
> > > > ch0->OutputGain=1;
> > > > ch0->OutputOffset=0;
> > > > ch0->SlaveGain=1;
> > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > ch0->BacklashAmount=0;
> > > > ch0->BacklashRate=0;
> > > > ch0->invDistPerCycle=1;
> > > > ch0->Lead=0;
> > > > ch0->MaxFollowingError=1000000000;
> > > > ch0->StepperAmplitude=20;
> > > >
> > > > ch0->iir[0].B0=1;
> > > > ch0->iir[0].B1=0;
> > > > ch0->iir[0].B2=0;
> > > > ch0->iir[0].A1=0;
> > > > ch0->iir[0].A2=0;
> > > >
> > > > ch0->iir[1].B0=1;
> > > > ch0->iir[1].B1=0;
> > > > ch0->iir[1].B2=0;
> > > > ch0->iir[1].A1=0;
> > > > ch0->iir[1].A2=0;
> > > >
> > > > ch0->iir[2].B0=0.0007689999765716;
> > > > ch0->iir[2].B1=0.001537999953143;
> > > > ch0->iir[2].B2=0.0007689999765716;
> > > > ch0->iir[2].A1=1.920809984207;
> > > > ch0->iir[2].A2=-0.9238849878311;
> > > > EnableAxisDest(0,0);
> > > >
> > > > ch1->InputMode=NO_INPUT_MODE;
> > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > ch1->Vel=40000;
> > > > ch1->Accel=400000;
> > > > ch1->Jerk=4000000;
> > > > ch1->P=0;
> > > > ch1->I=0.009999999776483;
> > > > ch1->D=0;
> > > > ch1->FFAccel=0;
> > > > ch1->FFVel=0;
> > > > ch1->MaxI=200;
> > > > ch1->MaxErr=1000000;
> > > > ch1->MaxOutput=200;
> > > > ch1->DeadBandGain=1;
> > > > ch1->DeadBandRange=0;
> > > > ch1->InputChan0=2;
> > > > ch1->InputChan1=0;
> > > > ch1->OutputChan0=2;
> > > > ch1->OutputChan1=0;
> > > > ch1->MasterAxis=-1;
> > > > ch1->LimitSwitchOptions=0x0;
> > > > ch1->InputGain0=1;
> > > > ch1->InputGain1=1;
> > > > ch1->InputOffset0=0;
> > > > ch1->InputOffset1=0;
> > > > ch1->OutputGain=1;
> > > > ch1->OutputOffset=0;
> > > > ch1->SlaveGain=1;
> > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > ch1->BacklashAmount=0;
> > > > ch1->BacklashRate=0;
> > > > ch1->invDistPerCycle=1;
> > > > ch1->Lead=0;
> > > > ch1->MaxFollowingError=1000000000;
> > > > ch1->StepperAmplitude=20;
> > > >
> > > > ch1->iir[0].B0=1;
> > > > ch1->iir[0].B1=0;
> > > > ch1->iir[0].B2=0;
> > > > ch1->iir[0].A1=0;
> > > > ch1->iir[0].A2=0;
> > > >
> > > > ch1->iir[1].B0=1;
> > > > ch1->iir[1].B1=0;
> > > > ch1->iir[1].B2=0;
> > > > ch1->iir[1].A1=0;
> > > > ch1->iir[1].A2=0;
> > > >
> > > > ch1->iir[2].B0=0.0007689999765716;
> > > > ch1->iir[2].B1=0.001537999953143;
> > > > ch1->iir[2].B2=0.0007689999765716;
> > > > ch1->iir[2].A1=1.920809984207;
> > > > ch1->iir[2].A2=-0.9238849878311;
> > > > EnableAxisDest(1,0);
> > > >
> > > > ch2->InputMode=NO_INPUT_MODE;
> > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > ch2->Vel=40000;
> > > > ch2->Accel=400000;
> > > > ch2->Jerk=4000000;
> > > > ch2->P=0;
> > > > ch2->I=0.009999999776483;
> > > > ch2->D=0;
> > > > ch2->FFAccel=0;
> > > > ch2->FFVel=0;
> > > > ch2->MaxI=200;
> > > > ch2->MaxErr=1000000;
> > > > ch2->MaxOutput=200;
> > > > ch2->DeadBandGain=1;
> > > > ch2->DeadBandRange=0;
> > > > ch2->InputChan0=0;
> > > > ch2->InputChan1=0;
> > > > ch2->OutputChan0=0;
> > > > ch2->OutputChan1=0;
> > > > ch2->MasterAxis=-1;
> > > > ch2->LimitSwitchOptions=0x30015;
> > > > ch2->InputGain0=1;
> > > > ch2->InputGain1=1;
> > > > ch2->InputOffset0=0;
> > > > ch2->InputOffset1=0;
> > > > ch2->OutputGain=1;
> > > > ch2->OutputOffset=0;
> > > > ch2->SlaveGain=1;
> > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > ch2->BacklashAmount=0;
> > > > ch2->BacklashRate=0;
> > > > ch2->invDistPerCycle=1;
> > > > ch2->Lead=0;
> > > > ch2->MaxFollowingError=1000000000;
> > > > ch2->StepperAmplitude=20;
> > > >
> > > > ch2->iir[0].B0=1;
> > > > ch2->iir[0].B1=0;
> > > > ch2->iir[0].B2=0;
> > > > ch2->iir[0].A1=0;
> > > > ch2->iir[0].A2=0;
> > > >
> > > > ch2->iir[1].B0=1;
> > > > ch2->iir[1].B1=0;
> > > > ch2->iir[1].B2=0;
> > > > ch2->iir[1].A1=0;
> > > > ch2->iir[1].A2=0;
> > > >
> > > > ch2->iir[2].B0=0.0007689999765716;
> > > > ch2->iir[2].B1=0.001537999953143;
> > > > ch2->iir[2].B2=0.0007689999765716;
> > > > ch2->iir[2].A1=1.920809984207;
> > > > ch2->iir[2].A2=-0.9238849878311;
> > > > EnableAxisDest(2,0);
> > > >
> > > > DefineCoordSystem(0,1,2,-1);
> > > >
> > > > return 0;
> > > > }
> > > >
> > > > And this is the one for the home switches.
> > > >
> > > > #include "KMotionDef.h"
> > > >
> > > > // Configuration and Homing program for a 3 axis System
> > > > // Limit switches are disabled and used as a home switch
> > > > // then they are re-enabled
> > > >
> > > > main()
> > > > {
> > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > >
> > > > DisableAxis(0); // Disable all axes
> > > > DisableAxis(1);
> > > > DisableAxis(2);
> > > >
> > > > // Set the axis parameters here
> > > > // after everything is configured in the KMotion Screens
> > > > // use copy C Code to clipboard on the configuration screen
> > > > // then paste here. Repeat for each axis
> > > >
> > > > ch0->InputMode=NO_INPUT_MODE;
> > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > ch0->Vel=40000;
> > > > ch0->Accel=400000;
> > > > ch0->Jerk=4000000;
> > > > ch0->P=0;
> > > > ch0->I=0.009999999776483;
> > > > ch0->D=0;
> > > > ch0->FFAccel=0;
> > > > ch0->FFVel=0;
> > > > ch0->MaxI=200;
> > > > ch0->MaxErr=1000000;
> > > > ch0->MaxOutput=200;
> > > > ch0->DeadBandGain=1;
> > > > ch0->DeadBandRange=0;
> > > > ch0->InputChan0=2;
> > > > ch0->InputChan1=0;
> > > > ch0->OutputChan0=2;
> > > > ch0->OutputChan1=0;
> > > > ch0->MasterAxis=-1;
> > > > ch0->LimitSwitchOptions=0x0;
> > > > ch0->InputGain0=1;
> > > > ch0->InputGain1=1;
> > > > ch0->InputOffset0=0;
> > > > ch0->InputOffset1=0;
> > > > ch0->OutputGain=1;
> > > > ch0->OutputOffset=0;
> > > > ch0->SlaveGain=1;
> > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > ch0->BacklashAmount=0;
> > > > ch0->BacklashRate=0;
> > > > ch0->invDistPerCycle=1;
> > > > ch0->Lead=0;
> > > > ch0->MaxFollowingError=1000000000;
> > > > ch0->StepperAmplitude=20;
> > > >
> > > > ch0->iir[0].B0=1;
> > > > ch0->iir[0].B1=0;
> > > > ch0->iir[0].B2=0;
> > > > ch0->iir[0].A1=0;
> > > > ch0->iir[0].A2=0;
> > > >
> > > > ch0->iir[1].B0=1;
> > > > ch0->iir[1].B1=0;
> > > > ch0->iir[1].B2=0;
> > > > ch0->iir[1].A1=0;
> > > > ch0->iir[1].A2=0;
> > > >
> > > > ch0->iir[2].B0=0.0007689999765716;
> > > > ch0->iir[2].B1=0.001537999953143;
> > > > ch0->iir[2].B2=0.0007689999765716;
> > > > ch0->iir[2].A1=1.920809984207;
> > > > ch0->iir[2].A2=-0.9238849878311;
> > > >
> > > > ch1->InputMode=NO_INPUT_MODE;
> > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > ch1->Vel=40000;
> > > > ch1->Accel=400000;
> > > > ch1->Jerk=4000000;
> > > > ch1->P=0;
> > > > ch1->I=0.009999999776483;
> > > > ch1->D=0;
> > > > ch1->FFAccel=0;
> > > > ch1->FFVel=0;
> > > > ch1->MaxI=200;
> > > > ch1->MaxErr=1000000;
> > > > ch1->MaxOutput=200;
> > > > ch1->DeadBandGain=1;
> > > > ch1->DeadBandRange=0;
> > > > ch1->InputChan0=2;
> > > > ch1->InputChan1=0;
> > > > ch1->OutputChan0=2;
> > > > ch1->OutputChan1=0;
> > > > ch1->MasterAxis=-1;
> > > > ch1->LimitSwitchOptions=0x0;
> > > > ch1->InputGain0=1;
> > > > ch1->InputGain1=1;
> > > > ch1->InputOffset0=0;
> > > > ch1->InputOffset1=0;
> > > > ch1->OutputGain=1;
> > > > ch1->OutputOffset=0;
> > > > ch1->SlaveGain=1;
> > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > ch1->BacklashAmount=0;
> > > > ch1->BacklashRate=0;
> > > > ch1->invDistPerCycle=1;
> > > > ch1->Lead=0;
> > > > ch1->MaxFollowingError=1000000000;
> > > > ch1->StepperAmplitude=20;
> > > >
> > > > ch1->iir[0].B0=1;
> > > > ch1->iir[0].B1=0;
> > > > ch1->iir[0].B2=0;
> > > > ch1->iir[0].A1=0;
> > > > ch1->iir[0].A2=0;
> > > >
> > > > ch1->iir[1].B0=1;
> > > > ch1->iir[1].B1=0;
> > > > ch1->iir[1].B2=0;
> > > > ch1->iir[1].A1=0;
> > > > ch1->iir[1].A2=0;
> > > >
> > > > ch1->iir[2].B0=0.0007689999765716;
> > > > ch1->iir[2].B1=0.001537999953143;
> > > > ch1->iir[2].B2=0.0007689999765716;
> > > > ch1->iir[2].A1=1.920809984207;
> > > > ch1->iir[2].A2=-0.9238849878311;
> > > >
> > > > ch2->InputMode=NO_INPUT_MODE;
> > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > ch2->Vel=40000;
> > > > ch2->Accel=400000;
> > > > ch2->Jerk=4000000;
> > > > ch2->P=0;
> > > > ch2->I=0.009999999776483;
> > > > ch2->D=0;
> > > > ch2->FFAccel=0;
> > > > ch2->FFVel=0;
> > > > ch2->MaxI=200;
> > > > ch2->MaxErr=1000000;
> > > > ch2->MaxOutput=200;
> > > > ch2->DeadBandGain=1;
> > > > ch2->DeadBandRange=0;
> > > > ch2->InputChan0=0;
> > > > ch2->InputChan1=0;
> > > > ch2->OutputChan0=0;
> > > > ch2->OutputChan1=0;
> > > > ch2->MasterAxis=-1;
> > > > ch2->LimitSwitchOptions=0x30015;
> > > > ch2->InputGain0=1;
> > > > ch2->InputGain1=1;
> > > > ch2->InputOffset0=0;
> > > > ch2->InputOffset1=0;
> > > > ch2->OutputGain=1;
> > > > ch2->OutputOffset=0;
> > > > ch2->SlaveGain=1;
> > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > ch2->BacklashAmount=0;
> > > > ch2->BacklashRate=0;
> > > > ch2->invDistPerCycle=1;
> > > > ch2->Lead=0;
> > > > ch2->MaxFollowingError=1000000000;
> > > > ch2->StepperAmplitude=20;
> > > >
> > > > ch2->iir[0].B0=1;
> > > > ch2->iir[0].B1=0;
> > > > ch2->iir[0].B2=0;
> > > > ch2->iir[0].A1=0;
> > > > ch2->iir[0].A2=0;
> > > >
> > > > ch2->iir[1].B0=1;
> > > > ch2->iir[1].B1=0;
> > > > ch2->iir[1].B2=0;
> > > > ch2->iir[1].A1=0;
> > > > ch2->iir[1].A2=0;
> > > >
> > > > ch2->iir[2].B0=0.0007689999765716;
> > > > ch2->iir[2].B1=0.001537999953143;
> > > > ch2->iir[2].B2=0.0007689999765716;
> > > > ch2->iir[2].A1=1.920809984207;
> > > > ch2->iir[2].A2=-0.9238849878311;
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > // disable the limits (first save how they were set)
> > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > ch0->LimitSwitchOptions = 0;
> > > > ch1->LimitSwitchOptions = 0;
> > > > ch2->LimitSwitchOptions = 0;
> > > >
> > > > // enable all 3 axes and begin servoing where we are
> > > >
> > > > EnableAxis(0);
> > > > EnableAxis(1);
> > > > EnableAxis(2);
> > > >
> > > > // Home Z up first - jog until it sees the limit
> > > >
> > > > Jog(2,100); // jog slowly positive
> > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > Jog(2,0); // stop
> > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > DisableAxis(2); // disable the axis
> > > > Zero(2); // Zero the position
> > > > EnableAxis(2); // re-enable the ServoTick
> > > > Move(2,-1000.0); // move some amount inside the limits
> > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > >
> > > > // Home X next - jog until it sees the limit
> > > >
> > > > Jog(0,-100); // jog slowly negative
> > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > Jog(0,0); // stop
> > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > DisableAxis(0); // disable the axis
> > > > Zero(0); // Zero the position
> > > > EnableAxis(0); // re-enable the ServoTick
> > > > Move(0,1000.0); // move some amount inside the limits
> > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > >
> > > > // Home Y next - jog until it sees the limit
> > > >
> > > > Jog(1,-100); // jog slowly negative
> > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > Jog(1,0); // stop
> > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > DisableAxis(1); // disable the axis
> > > > Zero(1); // Zero the position
> > > > EnableAxis(1); // re-enable the ServoTick
> > > > Move(1,1000.0); // move some amount inside the limits
> > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > >
> > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > }
> > > >
> > > > Thanks for all your help
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > > ÃÆ'‚ 
> > > > > Let's see:ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'‚ xÃÆ'‚  1mm /ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > ÃÆ'‚ 
> > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'‚ 
> > > > >
> > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'‚ 
> > > > > ÃÆ'‚ 
> > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'‚  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > ÃÆ'‚ 
> > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > ÃÆ'‚ 
> > > > > Regards
> > > > > TK
> > > > > ÃÆ'‚ 
> > > > >
> > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > >
> > > > >
> > > > > ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi TK
> > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > What is the max I can run?(I'm a speed demon)
> > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > Thanks again
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > That's good progress.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one already?ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Regards
> > > > > > TK
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Monday, June 20, 2011, 4:08 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi TK,
> > > > > >
> > > > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > > > Next question is the limit switches.
> > > > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > > > >
> > > > > > Thanks for your help we are getting there.
> > > > > >
> > > > > > John
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Did you read the links I sent?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything directly.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C program.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Regards
> > > > > > > TK
> > > > > > >
> > > > > > >
> > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi TK,
> > > > > > >
> > > > > > > Thanks for thr quick reply,
> > > > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > > > Thanks for your quick response.
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ function callÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ such asÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > > > > >
> > > > > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > HTH
> > > > > > > > TK
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi All,
> > > > > > > >
> > > > > > > > Im new to the Kflop board just got it out today for play.
> > > > > > > > I have managed to install the software and wire up a stepper motor.
> > > > > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Group: DynoMotion Message: 1364 From: jonny1bar Date: 6/25/2011
Subject: Re: Newbe needs help
Hi Tom
That worked perfectly thanks, I have a few more questions.
When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.

Thanks again

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
>  
>  
> Hi John,
>  
> The C language statement
>  
> while (!ReadBit(10)) ; // loop until IO bit goes high
>
> translated to English would be: loop doing nothing while a read of bit 10 is not true.
>  
> The " ! " is the NOT operator.  So remove the ! character for a home switch of the opposite polarity.
>  
>  
> Regarding the A Axis disabled.  There was a statement to declare X,Y,Z are used A unused:
>  
> DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
>
> I removed this statement from your Home Program because it should be in your Init program already.  Is it?  Do you have an Init program?
>  
> Regards
> TK
>  
>
> --- On Sat, 6/25/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Saturday, June 25, 2011, 6:50 AM
>
>
>  
>
>
>
> Hi Tom,
>
> Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> What is the best way to sort this.
> Could we set the loop until IO bit goes high to low somehow.
> Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
>
> Thanks
>
> John
>
> --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> >
> > Hi Tom
> >
> > Ok I will try to work it out
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > See Attached
> > >  
> > > Software is very expensive :}
> > >  
> > > TK
> > >
> > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Friday, June 24, 2011, 1:17 PM
> > >
> > >
> > >  
> > >
> > >
> > >
> > >
> > > Hi Tom
> > >
> > > Yes I use 1 switch for homeing and limit on each axis.
> > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > I am new to all this and need all the help I can get.
> > > I know of people that can help me but not sure how much it will cost.
> > > Thanks
> > >
> > > John
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > >  
> > > > The error is because you have a line of code to restore the Limit Switch Options but you never saved the options and a location to save them was never declared. 
> > > >  
> > > > Are you using the same switch for homing and a limit?  If you are then you need to:
> > > >
> > > > #1 declare a place to save the original settings
> > > >     Add an integer variable (inside the main function just after the bracket) with
> > > >  
> > > >     int SaveZLimits;
> > > >  
> > > >  
> > > > #2 save them before homing
> > > >  
> > > >    SaveZLimits = ch2->LimitSwitchOptions; // save original limit settings
> > > >
> > > > #3 disable the limits
> > > >  
> > > > ch2->LimitSwitchOptions = 0;  // disable limits
> > > >  
> > > >  
> > > > #4 restore them (after homing)
> > > >  
> > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > >
> > > >  
> > > >  
> > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > >  
> > > >  
> > > > Regards
> > > > TK
> > > >  
> > > >
> > > >
> > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > >
> > > >
> > > >  
> > > >
> > > >
> > > >
> > > > Hi Tom,
> > > >
> > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > If it works can i try it through mach3.
> > > > I have just worked out you can run the program from the c screen.
> > > > Were so close I can taste it.
> > > >
> > > > Thanks
> > > >
> > > > John
> > > >
> > > > #include "KMotionDef.h"
> > > >
> > > > // Configuration and Homing program for a 3 axis System
> > > > // Limit switches are disabled and used as a home switch
> > > > // then they are re-enabled
> > > >
> > > > main()
> > > > {
> > > >
> > > >
> > > > // enable all 3 axes and begin servoing where we are
> > > >
> > > > EnableAxis(0);
> > > > EnableAxis(1);
> > > > EnableAxis(2);
> > > >
> > > > // Home Z up first - jog until it sees the limit
> > > >
> > > > Jog(2,100); // jog slowly positive
> > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > Jog(2,0); // stop
> > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > DisableAxis(2); // disable the axis
> > > > Zero(2); // Zero the position
> > > > EnableAxis(2); // re-enable the ServoTick
> > > > Move(2,-1000.0); // move some amount inside the limits
> > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > >
> > > > // Home X next - jog until it sees the limit
> > > >
> > > > Jog(0,-100); // jog slowly negative
> > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > Jog(0,0); // stop
> > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > DisableAxis(0); // disable the axis
> > > > Zero(0); // Zero the position
> > > > EnableAxis(0); // re-enable the ServoTick
> > > > Move(0,1000.0); // move some amount inside the limits
> > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > >
> > > > // Home Y next - jog until it sees the limit
> > > >
> > > > Jog(1,-100); // jog slowly negative
> > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > Jog(1,0); // stop
> > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > DisableAxis(1); // disable the axis
> > > > Zero(1); // Zero the position
> > > > EnableAxis(1); // re-enable the ServoTick
> > > > Move(1,1000.0); // move some amount inside the limits
> > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > >
> > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > }
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > > ÃÆ'‚ 
> > > > > The code looks reasonable to me.ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > ÃÆ'‚ 
> > > > > For Mach3 each axis is homed separately.ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'‚  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > > > ÃÆ'‚ 
> > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > ÃÆ'‚ 
> > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'‚  See if that works.
> > > > > ÃÆ'‚ 
> > > > > Regards,
> > > > > TK
> > > > >
> > > > >
> > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > >
> > > > >
> > > > > ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi Tom,
> > > > >
> > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > >
> > > > > Can you also have a quick look at axis C code
> > > > >
> > > > > #include "KMotionDef.h"
> > > > >
> > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > // enables them
> > > > > // sets them as an xyz coordinate system for GCode
> > > > >
> > > > > int main()
> > > > > {
> > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > ch0->Vel=40000;
> > > > > ch0->Accel=400000;
> > > > > ch0->Jerk=4000000;
> > > > > ch0->P=0;
> > > > > ch0->I=0.009999999776483;
> > > > > ch0->D=0;
> > > > > ch0->FFAccel=0;
> > > > > ch0->FFVel=0;
> > > > > ch0->MaxI=200;
> > > > > ch0->MaxErr=1000000;
> > > > > ch0->MaxOutput=200;
> > > > > ch0->DeadBandGain=1;
> > > > > ch0->DeadBandRange=0;
> > > > > ch0->InputChan0=2;
> > > > > ch0->InputChan1=0;
> > > > > ch0->OutputChan0=2;
> > > > > ch0->OutputChan1=0;
> > > > > ch0->MasterAxis=-1;
> > > > > ch0->LimitSwitchOptions=0x0;
> > > > > ch0->InputGain0=1;
> > > > > ch0->InputGain1=1;
> > > > > ch0->InputOffset0=0;
> > > > > ch0->InputOffset1=0;
> > > > > ch0->OutputGain=1;
> > > > > ch0->OutputOffset=0;
> > > > > ch0->SlaveGain=1;
> > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > ch0->BacklashAmount=0;
> > > > > ch0->BacklashRate=0;
> > > > > ch0->invDistPerCycle=1;
> > > > > ch0->Lead=0;
> > > > > ch0->MaxFollowingError=1000000000;
> > > > > ch0->StepperAmplitude=20;
> > > > >
> > > > > ch0->iir[0].B0=1;
> > > > > ch0->iir[0].B1=0;
> > > > > ch0->iir[0].B2=0;
> > > > > ch0->iir[0].A1=0;
> > > > > ch0->iir[0].A2=0;
> > > > >
> > > > > ch0->iir[1].B0=1;
> > > > > ch0->iir[1].B1=0;
> > > > > ch0->iir[1].B2=0;
> > > > > ch0->iir[1].A1=0;
> > > > > ch0->iir[1].A2=0;
> > > > >
> > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > ch0->iir[2].A1=1.920809984207;
> > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > EnableAxisDest(0,0);
> > > > >
> > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > ch1->Vel=40000;
> > > > > ch1->Accel=400000;
> > > > > ch1->Jerk=4000000;
> > > > > ch1->P=0;
> > > > > ch1->I=0.009999999776483;
> > > > > ch1->D=0;
> > > > > ch1->FFAccel=0;
> > > > > ch1->FFVel=0;
> > > > > ch1->MaxI=200;
> > > > > ch1->MaxErr=1000000;
> > > > > ch1->MaxOutput=200;
> > > > > ch1->DeadBandGain=1;
> > > > > ch1->DeadBandRange=0;
> > > > > ch1->InputChan0=2;
> > > > > ch1->InputChan1=0;
> > > > > ch1->OutputChan0=2;
> > > > > ch1->OutputChan1=0;
> > > > > ch1->MasterAxis=-1;
> > > > > ch1->LimitSwitchOptions=0x0;
> > > > > ch1->InputGain0=1;
> > > > > ch1->InputGain1=1;
> > > > > ch1->InputOffset0=0;
> > > > > ch1->InputOffset1=0;
> > > > > ch1->OutputGain=1;
> > > > > ch1->OutputOffset=0;
> > > > > ch1->SlaveGain=1;
> > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > ch1->BacklashAmount=0;
> > > > > ch1->BacklashRate=0;
> > > > > ch1->invDistPerCycle=1;
> > > > > ch1->Lead=0;
> > > > > ch1->MaxFollowingError=1000000000;
> > > > > ch1->StepperAmplitude=20;
> > > > >
> > > > > ch1->iir[0].B0=1;
> > > > > ch1->iir[0].B1=0;
> > > > > ch1->iir[0].B2=0;
> > > > > ch1->iir[0].A1=0;
> > > > > ch1->iir[0].A2=0;
> > > > >
> > > > > ch1->iir[1].B0=1;
> > > > > ch1->iir[1].B1=0;
> > > > > ch1->iir[1].B2=0;
> > > > > ch1->iir[1].A1=0;
> > > > > ch1->iir[1].A2=0;
> > > > >
> > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > ch1->iir[2].A1=1.920809984207;
> > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > EnableAxisDest(1,0);
> > > > >
> > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > ch2->Vel=40000;
> > > > > ch2->Accel=400000;
> > > > > ch2->Jerk=4000000;
> > > > > ch2->P=0;
> > > > > ch2->I=0.009999999776483;
> > > > > ch2->D=0;
> > > > > ch2->FFAccel=0;
> > > > > ch2->FFVel=0;
> > > > > ch2->MaxI=200;
> > > > > ch2->MaxErr=1000000;
> > > > > ch2->MaxOutput=200;
> > > > > ch2->DeadBandGain=1;
> > > > > ch2->DeadBandRange=0;
> > > > > ch2->InputChan0=0;
> > > > > ch2->InputChan1=0;
> > > > > ch2->OutputChan0=0;
> > > > > ch2->OutputChan1=0;
> > > > > ch2->MasterAxis=-1;
> > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > ch2->InputGain0=1;
> > > > > ch2->InputGain1=1;
> > > > > ch2->InputOffset0=0;
> > > > > ch2->InputOffset1=0;
> > > > > ch2->OutputGain=1;
> > > > > ch2->OutputOffset=0;
> > > > > ch2->SlaveGain=1;
> > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > ch2->BacklashAmount=0;
> > > > > ch2->BacklashRate=0;
> > > > > ch2->invDistPerCycle=1;
> > > > > ch2->Lead=0;
> > > > > ch2->MaxFollowingError=1000000000;
> > > > > ch2->StepperAmplitude=20;
> > > > >
> > > > > ch2->iir[0].B0=1;
> > > > > ch2->iir[0].B1=0;
> > > > > ch2->iir[0].B2=0;
> > > > > ch2->iir[0].A1=0;
> > > > > ch2->iir[0].A2=0;
> > > > >
> > > > > ch2->iir[1].B0=1;
> > > > > ch2->iir[1].B1=0;
> > > > > ch2->iir[1].B2=0;
> > > > > ch2->iir[1].A1=0;
> > > > > ch2->iir[1].A2=0;
> > > > >
> > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > ch2->iir[2].A1=1.920809984207;
> > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > EnableAxisDest(2,0);
> > > > >
> > > > > DefineCoordSystem(0,1,2,-1);
> > > > >
> > > > > return 0;
> > > > > }
> > > > >
> > > > > And this is the one for the home switches.
> > > > >
> > > > > #include "KMotionDef.h"
> > > > >
> > > > > // Configuration and Homing program for a 3 axis System
> > > > > // Limit switches are disabled and used as a home switch
> > > > > // then they are re-enabled
> > > > >
> > > > > main()
> > > > > {
> > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > >
> > > > > DisableAxis(0); // Disable all axes
> > > > > DisableAxis(1);
> > > > > DisableAxis(2);
> > > > >
> > > > > // Set the axis parameters here
> > > > > // after everything is configured in the KMotion Screens
> > > > > // use copy C Code to clipboard on the configuration screen
> > > > > // then paste here. Repeat for each axis
> > > > >
> > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > ch0->Vel=40000;
> > > > > ch0->Accel=400000;
> > > > > ch0->Jerk=4000000;
> > > > > ch0->P=0;
> > > > > ch0->I=0.009999999776483;
> > > > > ch0->D=0;
> > > > > ch0->FFAccel=0;
> > > > > ch0->FFVel=0;
> > > > > ch0->MaxI=200;
> > > > > ch0->MaxErr=1000000;
> > > > > ch0->MaxOutput=200;
> > > > > ch0->DeadBandGain=1;
> > > > > ch0->DeadBandRange=0;
> > > > > ch0->InputChan0=2;
> > > > > ch0->InputChan1=0;
> > > > > ch0->OutputChan0=2;
> > > > > ch0->OutputChan1=0;
> > > > > ch0->MasterAxis=-1;
> > > > > ch0->LimitSwitchOptions=0x0;
> > > > > ch0->InputGain0=1;
> > > > > ch0->InputGain1=1;
> > > > > ch0->InputOffset0=0;
> > > > > ch0->InputOffset1=0;
> > > > > ch0->OutputGain=1;
> > > > > ch0->OutputOffset=0;
> > > > > ch0->SlaveGain=1;
> > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > ch0->BacklashAmount=0;
> > > > > ch0->BacklashRate=0;
> > > > > ch0->invDistPerCycle=1;
> > > > > ch0->Lead=0;
> > > > > ch0->MaxFollowingError=1000000000;
> > > > > ch0->StepperAmplitude=20;
> > > > >
> > > > > ch0->iir[0].B0=1;
> > > > > ch0->iir[0].B1=0;
> > > > > ch0->iir[0].B2=0;
> > > > > ch0->iir[0].A1=0;
> > > > > ch0->iir[0].A2=0;
> > > > >
> > > > > ch0->iir[1].B0=1;
> > > > > ch0->iir[1].B1=0;
> > > > > ch0->iir[1].B2=0;
> > > > > ch0->iir[1].A1=0;
> > > > > ch0->iir[1].A2=0;
> > > > >
> > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > ch0->iir[2].A1=1.920809984207;
> > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > >
> > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > ch1->Vel=40000;
> > > > > ch1->Accel=400000;
> > > > > ch1->Jerk=4000000;
> > > > > ch1->P=0;
> > > > > ch1->I=0.009999999776483;
> > > > > ch1->D=0;
> > > > > ch1->FFAccel=0;
> > > > > ch1->FFVel=0;
> > > > > ch1->MaxI=200;
> > > > > ch1->MaxErr=1000000;
> > > > > ch1->MaxOutput=200;
> > > > > ch1->DeadBandGain=1;
> > > > > ch1->DeadBandRange=0;
> > > > > ch1->InputChan0=2;
> > > > > ch1->InputChan1=0;
> > > > > ch1->OutputChan0=2;
> > > > > ch1->OutputChan1=0;
> > > > > ch1->MasterAxis=-1;
> > > > > ch1->LimitSwitchOptions=0x0;
> > > > > ch1->InputGain0=1;
> > > > > ch1->InputGain1=1;
> > > > > ch1->InputOffset0=0;
> > > > > ch1->InputOffset1=0;
> > > > > ch1->OutputGain=1;
> > > > > ch1->OutputOffset=0;
> > > > > ch1->SlaveGain=1;
> > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > ch1->BacklashAmount=0;
> > > > > ch1->BacklashRate=0;
> > > > > ch1->invDistPerCycle=1;
> > > > > ch1->Lead=0;
> > > > > ch1->MaxFollowingError=1000000000;
> > > > > ch1->StepperAmplitude=20;
> > > > >
> > > > > ch1->iir[0].B0=1;
> > > > > ch1->iir[0].B1=0;
> > > > > ch1->iir[0].B2=0;
> > > > > ch1->iir[0].A1=0;
> > > > > ch1->iir[0].A2=0;
> > > > >
> > > > > ch1->iir[1].B0=1;
> > > > > ch1->iir[1].B1=0;
> > > > > ch1->iir[1].B2=0;
> > > > > ch1->iir[1].A1=0;
> > > > > ch1->iir[1].A2=0;
> > > > >
> > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > ch1->iir[2].A1=1.920809984207;
> > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > >
> > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > ch2->Vel=40000;
> > > > > ch2->Accel=400000;
> > > > > ch2->Jerk=4000000;
> > > > > ch2->P=0;
> > > > > ch2->I=0.009999999776483;
> > > > > ch2->D=0;
> > > > > ch2->FFAccel=0;
> > > > > ch2->FFVel=0;
> > > > > ch2->MaxI=200;
> > > > > ch2->MaxErr=1000000;
> > > > > ch2->MaxOutput=200;
> > > > > ch2->DeadBandGain=1;
> > > > > ch2->DeadBandRange=0;
> > > > > ch2->InputChan0=0;
> > > > > ch2->InputChan1=0;
> > > > > ch2->OutputChan0=0;
> > > > > ch2->OutputChan1=0;
> > > > > ch2->MasterAxis=-1;
> > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > ch2->InputGain0=1;
> > > > > ch2->InputGain1=1;
> > > > > ch2->InputOffset0=0;
> > > > > ch2->InputOffset1=0;
> > > > > ch2->OutputGain=1;
> > > > > ch2->OutputOffset=0;
> > > > > ch2->SlaveGain=1;
> > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > ch2->BacklashAmount=0;
> > > > > ch2->BacklashRate=0;
> > > > > ch2->invDistPerCycle=1;
> > > > > ch2->Lead=0;
> > > > > ch2->MaxFollowingError=1000000000;
> > > > > ch2->StepperAmplitude=20;
> > > > >
> > > > > ch2->iir[0].B0=1;
> > > > > ch2->iir[0].B1=0;
> > > > > ch2->iir[0].B2=0;
> > > > > ch2->iir[0].A1=0;
> > > > > ch2->iir[0].A2=0;
> > > > >
> > > > > ch2->iir[1].B0=1;
> > > > > ch2->iir[1].B1=0;
> > > > > ch2->iir[1].B2=0;
> > > > > ch2->iir[1].A1=0;
> > > > > ch2->iir[1].A2=0;
> > > > >
> > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > ch2->iir[2].A1=1.920809984207;
> > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > // disable the limits (first save how they were set)
> > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > ch0->LimitSwitchOptions = 0;
> > > > > ch1->LimitSwitchOptions = 0;
> > > > > ch2->LimitSwitchOptions = 0;
> > > > >
> > > > > // enable all 3 axes and begin servoing where we are
> > > > >
> > > > > EnableAxis(0);
> > > > > EnableAxis(1);
> > > > > EnableAxis(2);
> > > > >
> > > > > // Home Z up first - jog until it sees the limit
> > > > >
> > > > > Jog(2,100); // jog slowly positive
> > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > Jog(2,0); // stop
> > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > DisableAxis(2); // disable the axis
> > > > > Zero(2); // Zero the position
> > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > >
> > > > > // Home X next - jog until it sees the limit
> > > > >
> > > > > Jog(0,-100); // jog slowly negative
> > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > Jog(0,0); // stop
> > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > DisableAxis(0); // disable the axis
> > > > > Zero(0); // Zero the position
> > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > >
> > > > > // Home Y next - jog until it sees the limit
> > > > >
> > > > > Jog(1,-100); // jog slowly negative
> > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > Jog(1,0); // stop
> > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > DisableAxis(1); // disable the axis
> > > > > Zero(1); // Zero the position
> > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > >
> > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > }
> > > > >
> > > > > Thanks for all your help
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Let's see:ÃÆ'Æ'‚ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'‚ÃÆ'‚  1mm /ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'‚ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'‚ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'Æ'‚ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'Æ'‚ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.ÃÆ'Æ'‚ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'Æ'‚ÃÆ'‚  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'Æ'‚ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Regards
> > > > > > TK
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > > >
> > > > > >
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi TK
> > > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > > What is the max I can run?(I'm a speed demon)
> > > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > > Thanks again
> > > > > >
> > > > > > John
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > That's good progress.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one already?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Regards
> > > > > > > TK
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Monday, June 20, 2011, 4:08 AM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi TK,
> > > > > > >
> > > > > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > > > > Next question is the limit switches.
> > > > > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > > > > >
> > > > > > > Thanks for your help we are getting there.
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Did you read the links I sent?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything directly.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C
> program.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi TK,
> > > > > > > >
> > > > > > > > Thanks for thr quick reply,
> > > > > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > > > > Thanks for your quick response.
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ function
> callÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ such asÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > > > > > >
> > > > > > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > HTH
> > > > > > > > > TK
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Newbe needs help
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi All,
> > > > > > > > >
> > > > > > > > > Im new to the Kflop board just got it out today for play.
> > > > > > > > > I have managed to install the software and wire up a stepper motor.
> > > > > > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > > > > > >
> > > > > > > > > Thanks
> > > > > > > > >
> > > > > > > > > John
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 1380 From: jonny1bar Date: 6/27/2011
Subject: Re: Newbe needs help
Hi Tom
Did you get a chance to look at my request

John

--- In DynoMotion@yahoogroups.com, "jonny1bar" <john@...> wrote:
>
> Hi Tom
> That worked perfectly thanks, I have a few more questions.
> When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
>
> Thanks again
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> >  
> >  
> > Hi John,
> >  
> > The C language statement
> >  
> > while (!ReadBit(10)) ; // loop until IO bit goes high
> >
> > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> >  
> > The " ! " is the NOT operator.  So remove the ! character for a home switch of the opposite polarity.
> >  
> >  
> > Regarding the A Axis disabled.  There was a statement to declare X,Y,Z are used A unused:
> >  
> > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> >
> > I removed this statement from your Home Program because it should be in your Init program already.  Is it?  Do you have an Init program?
> >  
> > Regards
> > TK
> >  
> >
> > --- On Sat, 6/25/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Saturday, June 25, 2011, 6:50 AM
> >
> >
> >  
> >
> >
> >
> > Hi Tom,
> >
> > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > What is the best way to sort this.
> > Could we set the loop until IO bit goes high to low somehow.
> > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
> >
> > Thanks
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > >
> > > Hi Tom
> > >
> > > Ok I will try to work it out
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > >  
> > > > See Attached
> > > >  
> > > > Software is very expensive :}
> > > >  
> > > > TK
> > > >
> > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Friday, June 24, 2011, 1:17 PM
> > > >
> > > >
> > > >  
> > > >
> > > >
> > > >
> > > >
> > > > Hi Tom
> > > >
> > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > I am new to all this and need all the help I can get.
> > > > I know of people that can help me but not sure how much it will cost.
> > > > Thanks
> > > >
> > > > John
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > >  
> > > > > The error is because you have a line of code to restore the Limit Switch Options but you never saved the options and a location to save them was never declared. 
> > > > >  
> > > > > Are you using the same switch for homing and a limit?  If you are then you need to:
> > > > >
> > > > > #1 declare a place to save the original settings
> > > > >     Add an integer variable (inside the main function just after the bracket) with
> > > > >  
> > > > >     int SaveZLimits;
> > > > >  
> > > > >  
> > > > > #2 save them before homing
> > > > >  
> > > > >    SaveZLimits = ch2->LimitSwitchOptions; // save original limit settings
> > > > >
> > > > > #3 disable the limits
> > > > >  
> > > > > ch2->LimitSwitchOptions = 0;  // disable limits
> > > > >  
> > > > >  
> > > > > #4 restore them (after homing)
> > > > >  
> > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > >
> > > > >  
> > > > >  
> > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > >  
> > > > >  
> > > > > Regards
> > > > > TK
> > > > >  
> > > > >
> > > > >
> > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > > >
> > > > >
> > > > >  
> > > > >
> > > > >
> > > > >
> > > > > Hi Tom,
> > > > >
> > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > If it works can i try it through mach3.
> > > > > I have just worked out you can run the program from the c screen.
> > > > > Were so close I can taste it.
> > > > >
> > > > > Thanks
> > > > >
> > > > > John
> > > > >
> > > > > #include "KMotionDef.h"
> > > > >
> > > > > // Configuration and Homing program for a 3 axis System
> > > > > // Limit switches are disabled and used as a home switch
> > > > > // then they are re-enabled
> > > > >
> > > > > main()
> > > > > {
> > > > >
> > > > >
> > > > > // enable all 3 axes and begin servoing where we are
> > > > >
> > > > > EnableAxis(0);
> > > > > EnableAxis(1);
> > > > > EnableAxis(2);
> > > > >
> > > > > // Home Z up first - jog until it sees the limit
> > > > >
> > > > > Jog(2,100); // jog slowly positive
> > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > Jog(2,0); // stop
> > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > DisableAxis(2); // disable the axis
> > > > > Zero(2); // Zero the position
> > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > >
> > > > > // Home X next - jog until it sees the limit
> > > > >
> > > > > Jog(0,-100); // jog slowly negative
> > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > Jog(0,0); // stop
> > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > DisableAxis(0); // disable the axis
> > > > > Zero(0); // Zero the position
> > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > >
> > > > > // Home Y next - jog until it sees the limit
> > > > >
> > > > > Jog(1,-100); // jog slowly negative
> > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > Jog(1,0); // stop
> > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > DisableAxis(1); // disable the axis
> > > > > Zero(1); // Zero the position
> > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > >
> > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > }
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'‚ 
> > > > > > The code looks reasonable to me.ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > ÃÆ'‚ 
> > > > > > For Mach3 each axis is homed separately.ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'‚  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > > > > ÃÆ'‚ 
> > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > ÃÆ'‚ 
> > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'‚  See if that works.
> > > > > > ÃÆ'‚ 
> > > > > > Regards,
> > > > > > TK
> > > > > >
> > > > > >
> > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi Tom,
> > > > > >
> > > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > >
> > > > > > Can you also have a quick look at axis C code
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > >
> > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > // enables them
> > > > > > // sets them as an xyz coordinate system for GCode
> > > > > >
> > > > > > int main()
> > > > > > {
> > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > ch0->Vel=40000;
> > > > > > ch0->Accel=400000;
> > > > > > ch0->Jerk=4000000;
> > > > > > ch0->P=0;
> > > > > > ch0->I=0.009999999776483;
> > > > > > ch0->D=0;
> > > > > > ch0->FFAccel=0;
> > > > > > ch0->FFVel=0;
> > > > > > ch0->MaxI=200;
> > > > > > ch0->MaxErr=1000000;
> > > > > > ch0->MaxOutput=200;
> > > > > > ch0->DeadBandGain=1;
> > > > > > ch0->DeadBandRange=0;
> > > > > > ch0->InputChan0=2;
> > > > > > ch0->InputChan1=0;
> > > > > > ch0->OutputChan0=2;
> > > > > > ch0->OutputChan1=0;
> > > > > > ch0->MasterAxis=-1;
> > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > ch0->InputGain0=1;
> > > > > > ch0->InputGain1=1;
> > > > > > ch0->InputOffset0=0;
> > > > > > ch0->InputOffset1=0;
> > > > > > ch0->OutputGain=1;
> > > > > > ch0->OutputOffset=0;
> > > > > > ch0->SlaveGain=1;
> > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > ch0->BacklashAmount=0;
> > > > > > ch0->BacklashRate=0;
> > > > > > ch0->invDistPerCycle=1;
> > > > > > ch0->Lead=0;
> > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > ch0->StepperAmplitude=20;
> > > > > >
> > > > > > ch0->iir[0].B0=1;
> > > > > > ch0->iir[0].B1=0;
> > > > > > ch0->iir[0].B2=0;
> > > > > > ch0->iir[0].A1=0;
> > > > > > ch0->iir[0].A2=0;
> > > > > >
> > > > > > ch0->iir[1].B0=1;
> > > > > > ch0->iir[1].B1=0;
> > > > > > ch0->iir[1].B2=0;
> > > > > > ch0->iir[1].A1=0;
> > > > > > ch0->iir[1].A2=0;
> > > > > >
> > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > EnableAxisDest(0,0);
> > > > > >
> > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > ch1->Vel=40000;
> > > > > > ch1->Accel=400000;
> > > > > > ch1->Jerk=4000000;
> > > > > > ch1->P=0;
> > > > > > ch1->I=0.009999999776483;
> > > > > > ch1->D=0;
> > > > > > ch1->FFAccel=0;
> > > > > > ch1->FFVel=0;
> > > > > > ch1->MaxI=200;
> > > > > > ch1->MaxErr=1000000;
> > > > > > ch1->MaxOutput=200;
> > > > > > ch1->DeadBandGain=1;
> > > > > > ch1->DeadBandRange=0;
> > > > > > ch1->InputChan0=2;
> > > > > > ch1->InputChan1=0;
> > > > > > ch1->OutputChan0=2;
> > > > > > ch1->OutputChan1=0;
> > > > > > ch1->MasterAxis=-1;
> > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > ch1->InputGain0=1;
> > > > > > ch1->InputGain1=1;
> > > > > > ch1->InputOffset0=0;
> > > > > > ch1->InputOffset1=0;
> > > > > > ch1->OutputGain=1;
> > > > > > ch1->OutputOffset=0;
> > > > > > ch1->SlaveGain=1;
> > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > ch1->BacklashAmount=0;
> > > > > > ch1->BacklashRate=0;
> > > > > > ch1->invDistPerCycle=1;
> > > > > > ch1->Lead=0;
> > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > ch1->StepperAmplitude=20;
> > > > > >
> > > > > > ch1->iir[0].B0=1;
> > > > > > ch1->iir[0].B1=0;
> > > > > > ch1->iir[0].B2=0;
> > > > > > ch1->iir[0].A1=0;
> > > > > > ch1->iir[0].A2=0;
> > > > > >
> > > > > > ch1->iir[1].B0=1;
> > > > > > ch1->iir[1].B1=0;
> > > > > > ch1->iir[1].B2=0;
> > > > > > ch1->iir[1].A1=0;
> > > > > > ch1->iir[1].A2=0;
> > > > > >
> > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > EnableAxisDest(1,0);
> > > > > >
> > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > ch2->Vel=40000;
> > > > > > ch2->Accel=400000;
> > > > > > ch2->Jerk=4000000;
> > > > > > ch2->P=0;
> > > > > > ch2->I=0.009999999776483;
> > > > > > ch2->D=0;
> > > > > > ch2->FFAccel=0;
> > > > > > ch2->FFVel=0;
> > > > > > ch2->MaxI=200;
> > > > > > ch2->MaxErr=1000000;
> > > > > > ch2->MaxOutput=200;
> > > > > > ch2->DeadBandGain=1;
> > > > > > ch2->DeadBandRange=0;
> > > > > > ch2->InputChan0=0;
> > > > > > ch2->InputChan1=0;
> > > > > > ch2->OutputChan0=0;
> > > > > > ch2->OutputChan1=0;
> > > > > > ch2->MasterAxis=-1;
> > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > ch2->InputGain0=1;
> > > > > > ch2->InputGain1=1;
> > > > > > ch2->InputOffset0=0;
> > > > > > ch2->InputOffset1=0;
> > > > > > ch2->OutputGain=1;
> > > > > > ch2->OutputOffset=0;
> > > > > > ch2->SlaveGain=1;
> > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > ch2->BacklashAmount=0;
> > > > > > ch2->BacklashRate=0;
> > > > > > ch2->invDistPerCycle=1;
> > > > > > ch2->Lead=0;
> > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > ch2->StepperAmplitude=20;
> > > > > >
> > > > > > ch2->iir[0].B0=1;
> > > > > > ch2->iir[0].B1=0;
> > > > > > ch2->iir[0].B2=0;
> > > > > > ch2->iir[0].A1=0;
> > > > > > ch2->iir[0].A2=0;
> > > > > >
> > > > > > ch2->iir[1].B0=1;
> > > > > > ch2->iir[1].B1=0;
> > > > > > ch2->iir[1].B2=0;
> > > > > > ch2->iir[1].A1=0;
> > > > > > ch2->iir[1].A2=0;
> > > > > >
> > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > EnableAxisDest(2,0);
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > >
> > > > > > return 0;
> > > > > > }
> > > > > >
> > > > > > And this is the one for the home switches.
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > >
> > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > // Limit switches are disabled and used as a home switch
> > > > > > // then they are re-enabled
> > > > > >
> > > > > > main()
> > > > > > {
> > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > >
> > > > > > DisableAxis(0); // Disable all axes
> > > > > > DisableAxis(1);
> > > > > > DisableAxis(2);
> > > > > >
> > > > > > // Set the axis parameters here
> > > > > > // after everything is configured in the KMotion Screens
> > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > // then paste here. Repeat for each axis
> > > > > >
> > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > ch0->Vel=40000;
> > > > > > ch0->Accel=400000;
> > > > > > ch0->Jerk=4000000;
> > > > > > ch0->P=0;
> > > > > > ch0->I=0.009999999776483;
> > > > > > ch0->D=0;
> > > > > > ch0->FFAccel=0;
> > > > > > ch0->FFVel=0;
> > > > > > ch0->MaxI=200;
> > > > > > ch0->MaxErr=1000000;
> > > > > > ch0->MaxOutput=200;
> > > > > > ch0->DeadBandGain=1;
> > > > > > ch0->DeadBandRange=0;
> > > > > > ch0->InputChan0=2;
> > > > > > ch0->InputChan1=0;
> > > > > > ch0->OutputChan0=2;
> > > > > > ch0->OutputChan1=0;
> > > > > > ch0->MasterAxis=-1;
> > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > ch0->InputGain0=1;
> > > > > > ch0->InputGain1=1;
> > > > > > ch0->InputOffset0=0;
> > > > > > ch0->InputOffset1=0;
> > > > > > ch0->OutputGain=1;
> > > > > > ch0->OutputOffset=0;
> > > > > > ch0->SlaveGain=1;
> > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > ch0->BacklashAmount=0;
> > > > > > ch0->BacklashRate=0;
> > > > > > ch0->invDistPerCycle=1;
> > > > > > ch0->Lead=0;
> > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > ch0->StepperAmplitude=20;
> > > > > >
> > > > > > ch0->iir[0].B0=1;
> > > > > > ch0->iir[0].B1=0;
> > > > > > ch0->iir[0].B2=0;
> > > > > > ch0->iir[0].A1=0;
> > > > > > ch0->iir[0].A2=0;
> > > > > >
> > > > > > ch0->iir[1].B0=1;
> > > > > > ch0->iir[1].B1=0;
> > > > > > ch0->iir[1].B2=0;
> > > > > > ch0->iir[1].A1=0;
> > > > > > ch0->iir[1].A2=0;
> > > > > >
> > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > >
> > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > ch1->Vel=40000;
> > > > > > ch1->Accel=400000;
> > > > > > ch1->Jerk=4000000;
> > > > > > ch1->P=0;
> > > > > > ch1->I=0.009999999776483;
> > > > > > ch1->D=0;
> > > > > > ch1->FFAccel=0;
> > > > > > ch1->FFVel=0;
> > > > > > ch1->MaxI=200;
> > > > > > ch1->MaxErr=1000000;
> > > > > > ch1->MaxOutput=200;
> > > > > > ch1->DeadBandGain=1;
> > > > > > ch1->DeadBandRange=0;
> > > > > > ch1->InputChan0=2;
> > > > > > ch1->InputChan1=0;
> > > > > > ch1->OutputChan0=2;
> > > > > > ch1->OutputChan1=0;
> > > > > > ch1->MasterAxis=-1;
> > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > ch1->InputGain0=1;
> > > > > > ch1->InputGain1=1;
> > > > > > ch1->InputOffset0=0;
> > > > > > ch1->InputOffset1=0;
> > > > > > ch1->OutputGain=1;
> > > > > > ch1->OutputOffset=0;
> > > > > > ch1->SlaveGain=1;
> > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > ch1->BacklashAmount=0;
> > > > > > ch1->BacklashRate=0;
> > > > > > ch1->invDistPerCycle=1;
> > > > > > ch1->Lead=0;
> > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > ch1->StepperAmplitude=20;
> > > > > >
> > > > > > ch1->iir[0].B0=1;
> > > > > > ch1->iir[0].B1=0;
> > > > > > ch1->iir[0].B2=0;
> > > > > > ch1->iir[0].A1=0;
> > > > > > ch1->iir[0].A2=0;
> > > > > >
> > > > > > ch1->iir[1].B0=1;
> > > > > > ch1->iir[1].B1=0;
> > > > > > ch1->iir[1].B2=0;
> > > > > > ch1->iir[1].A1=0;
> > > > > > ch1->iir[1].A2=0;
> > > > > >
> > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > >
> > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > ch2->Vel=40000;
> > > > > > ch2->Accel=400000;
> > > > > > ch2->Jerk=4000000;
> > > > > > ch2->P=0;
> > > > > > ch2->I=0.009999999776483;
> > > > > > ch2->D=0;
> > > > > > ch2->FFAccel=0;
> > > > > > ch2->FFVel=0;
> > > > > > ch2->MaxI=200;
> > > > > > ch2->MaxErr=1000000;
> > > > > > ch2->MaxOutput=200;
> > > > > > ch2->DeadBandGain=1;
> > > > > > ch2->DeadBandRange=0;
> > > > > > ch2->InputChan0=0;
> > > > > > ch2->InputChan1=0;
> > > > > > ch2->OutputChan0=0;
> > > > > > ch2->OutputChan1=0;
> > > > > > ch2->MasterAxis=-1;
> > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > ch2->InputGain0=1;
> > > > > > ch2->InputGain1=1;
> > > > > > ch2->InputOffset0=0;
> > > > > > ch2->InputOffset1=0;
> > > > > > ch2->OutputGain=1;
> > > > > > ch2->OutputOffset=0;
> > > > > > ch2->SlaveGain=1;
> > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > ch2->BacklashAmount=0;
> > > > > > ch2->BacklashRate=0;
> > > > > > ch2->invDistPerCycle=1;
> > > > > > ch2->Lead=0;
> > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > ch2->StepperAmplitude=20;
> > > > > >
> > > > > > ch2->iir[0].B0=1;
> > > > > > ch2->iir[0].B1=0;
> > > > > > ch2->iir[0].B2=0;
> > > > > > ch2->iir[0].A1=0;
> > > > > > ch2->iir[0].A2=0;
> > > > > >
> > > > > > ch2->iir[1].B0=1;
> > > > > > ch2->iir[1].B1=0;
> > > > > > ch2->iir[1].B2=0;
> > > > > > ch2->iir[1].A1=0;
> > > > > > ch2->iir[1].A2=0;
> > > > > >
> > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > // disable the limits (first save how they were set)
> > > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > ch2->LimitSwitchOptions = 0;
> > > > > >
> > > > > > // enable all 3 axes and begin servoing where we are
> > > > > >
> > > > > > EnableAxis(0);
> > > > > > EnableAxis(1);
> > > > > > EnableAxis(2);
> > > > > >
> > > > > > // Home Z up first - jog until it sees the limit
> > > > > >
> > > > > > Jog(2,100); // jog slowly positive
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > Jog(2,0); // stop
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > DisableAxis(2); // disable the axis
> > > > > > Zero(2); // Zero the position
> > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > >
> > > > > > // Home X next - jog until it sees the limit
> > > > > >
> > > > > > Jog(0,-100); // jog slowly negative
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > Jog(0,0); // stop
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > DisableAxis(0); // disable the axis
> > > > > > Zero(0); // Zero the position
> > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > >
> > > > > > // Home Y next - jog until it sees the limit
> > > > > >
> > > > > > Jog(1,-100); // jog slowly negative
> > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > Jog(1,0); // stop
> > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > DisableAxis(1); // disable the axis
> > > > > > Zero(1); // Zero the position
> > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > }
> > > > > >
> > > > > > Thanks for all your help
> > > > > >
> > > > > > John
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Let's see:ÃÆ'Æ'‚ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'‚ÃÆ'‚  1mm /ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'‚ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'‚ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'Æ'‚ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'Æ'‚ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.ÃÆ'Æ'‚ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'Æ'‚ÃÆ'‚  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'Æ'‚ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Regards
> > > > > > > TK
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi TK
> > > > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > > > What is the max I can run?(I'm a speed demon)
> > > > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > > > Thanks again
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > That's good progress.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one already?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Monday, June 20, 2011, 4:08 AM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi TK,
> > > > > > > >
> > > > > > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > > > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > > > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > > > > > Next question is the limit switches.
> > > > > > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > > > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > > > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > > > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > > > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > > > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > > > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > > > > > >
> > > > > > > > Thanks for your help we are getting there.
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Did you read the links I sent?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything directly.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C
> > program.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Regards
> > > > > > > > > TK
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi TK,
> > > > > > > > >
> > > > > > > > > Thanks for thr quick reply,
> > > > > > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > > > > > Thanks for your quick response.
> > > > > > > > >
> > > > > > > > > John
> > > > > > > > >
> > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > >
> > > > > > > > > > Hi John,
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion ProgramÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C LanguageÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ function
> > callÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ such asÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > > > > > > >
> > > > > > > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > HTH
> > > > > > > > > > TK
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > > Subject: [DynoMotion] Newbe needs help
> > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi All,
> > > > > > > > > >
> > > > > > > > > > Im new to the Kflop board just got it out today for play.
> > > > > > > > > > I have managed to install the software and wire up a stepper motor.
> > > > > > > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > > > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > > > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > > > > > > >
> > > > > > > > > > Thanks
> > > > > > > > > >
> > > > > > > > > > John
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 1381 From: Tom Kerekes Date: 6/27/2011
Subject: Re: Newbe needs help
Hi John,
 
Sorry about that. I sent a response last Saturday and I see it in my "sent" folder but somehow it wasn't posted.
 
here it is again...
 
 
 
Hi John,
 
Sorry I don't really understand your description.  It *should* stop homing when the switch is activated correct?   But it should not stop because of a limit fault.  Regardless of how limits are configured we are disabling limits while homing so I don't understand that comment either.
 
Let's just get Homing C program to work correctly first before trying to use Mach3.  As I described previously, Mach3 calls your Home.c program multiple times (once for each axis) so we need to add stuff to the C Program so it only homes the axis that Mach3 is requesting to be homed rather than all of them.
 
Unconnected and unused Inputs will float to random values.  This is normal.
 
Regards
TK


--- On Mon, 6/27/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Monday, June 27, 2011, 3:07 PM

 
Hi Tom
Did you get a chance to look at my request

John

--- In DynoMotion@yahoogroups.com, "jonny1bar" <john@...> wrote:
>
> Hi Tom
> That worked perfectly thanks, I have a few more questions.
> When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
>
> Thanks again
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> >  
> >  
> > Hi John,
> >  
> > The C language statement
> >  
> > while (!ReadBit(10)) ; // loop until IO bit goes high
> >
> > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> >  
> > The " ! " is the NOT operator.  So remove the ! character for a home switch of the opposite polarity.
> >  
> >  
> > Regarding the A Axis disabled.  There was a statement to declare X,Y,Z are used A unused:
> >  
> > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> >
> > I removed this statement from your Home Program because it should be in your Init program already.  Is it?  Do you have an Init program?
> >  
> > Regards
> > TK
> >  
> >
> > --- On Sat, 6/25/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Saturday, June 25, 2011, 6:50 AM
> >
> >
> >  
> >
> >
> >
> > Hi Tom,
> >
> > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > What is the best way to sort this.
> > Could we set the loop until IO bit goes high to low somehow.
> > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
> >
> > Thanks
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > >
> > > Hi Tom
> > >
> > > Ok I will try to work it out
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > >  
> > > > See Attached
> > > >  
> > > > Software is very expensive :}
> > > >  
> > > > TK
> > > >
> > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Friday, June 24, 2011, 1:17 PM
> > > >
> > > >
> > > >  
> > > >
> > > >
> > > >
> > > >
> > > > Hi Tom
> > > >
> > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > I am new to all this and need all the help I can get.
> > > > I know of people that can help me but not sure how much it will cost.
> > > > Thanks
> > > >
> > > > John
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > >  
> > > > > The error is because you have a line of code to restore the Limit Switch Options but you never saved the options and a location to save them was never declared. 
> > > > >  
> > > > > Are you using the same switch for homing and a limit?  If you are then you need to:
> > > > >
> > > > > #1 declare a place to save the original settings
> > > > >     Add an integer variable (inside the main function just after the bracket) with
> > > > >  
> > > > >     int SaveZLimits;
> > > > >  
> > > > >  
> > > > > #2 save them before homing
> > > > >  
> > > > >    SaveZLimits = ch2->LimitSwitchOptions; // save original limit settings
> > > > >
> > > > > #3 disable the limits
> > > > >  
> > > > > ch2->LimitSwitchOptions = 0;  // disable limits
> > > > >  
> > > > >  
> > > > > #4 restore them (after homing)
> > > > >  
> > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > >
> > > > >  
> > > > >  
> > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > >  
> > > > >  
> > > > > Regards
> > > > > TK
> > > > >  
> > > > >
> > > > >
> > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > > >
> > > > >
> > > > >  
> > > > >
> > > > >
> > > > >
> > > > > Hi Tom,
> > > > >
> > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > If it works can i try it through mach3.
> > > > > I have just worked out you can run the program from the c screen.
> > > > > Were so close I can taste it.
> > > > >
> > > > > Thanks
> > > > >
> > > > > John
> > > > >
> > > > > #include "KMotionDef.h"
> > > > >
> > > > > // Configuration and Homing program for a 3 axis System
> > > > > // Limit switches are disabled and used as a home switch
> > > > > // then they are re-enabled
> > > > >
> > > > > main()
> > > > > {
> > > > >
> > > > >
> > > > > // enable all 3 axes and begin servoing where we are
> > > > >
> > > > > EnableAxis(0);
> > > > > EnableAxis(1);
> > > > > EnableAxis(2);
> > > > >
> > > > > // Home Z up first - jog until it sees the limit
> > > > >
> > > > > Jog(2,100); // jog slowly positive
> > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > Jog(2,0); // stop
> > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > DisableAxis(2); // disable the axis
> > > > > Zero(2); // Zero the position
> > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > >
> > > > > // Home X next - jog until it sees the limit
> > > > >
> > > > > Jog(0,-100); // jog slowly negative
> > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > Jog(0,0); // stop
> > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > DisableAxis(0); // disable the axis
> > > > > Zero(0); // Zero the position
> > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > >
> > > > > // Home Y next - jog until it sees the limit
> > > > >
> > > > > Jog(1,-100); // jog slowly negative
> > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > Jog(1,0); // stop
> > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > DisableAxis(1); // disable the axis
> > > > > Zero(1); // Zero the position
> > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > >
> > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > }
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'‚ 
> > > > > > The code looks reasonable to me.ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > ÃÆ'‚ 
> > > > > > For Mach3 each axis is homed separately.ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'‚  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > > > > ÃÆ'‚ 
> > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > ÃÆ'‚ 
> > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'‚  See if that works.
> > > > > > ÃÆ'‚ 
> > > > > > Regards,
> > > > > > TK
> > > > > >
> > > > > >
> > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi Tom,
> > > > > >
> > > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > >
> > > > > > Can you also have a quick look at axis C code
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > >
> > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > // enables them
> > > > > > // sets them as an xyz coordinate system for GCode
> > > > > >
> > > > > > int main()
> > > > > > {
> > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > ch0->Vel=40000;
> > > > > > ch0->Accel=400000;
> > > > > > ch0->Jerk=4000000;
> > > > > > ch0->P=0;
> > > > > > ch0->I=0.009999999776483;
> > > > > > ch0->D=0;
> > > > > > ch0->FFAccel=0;
> > > > > > ch0->FFVel=0;
> > > > > > ch0->MaxI=200;
> > > > > > ch0->MaxErr=1000000;
> > > > > > ch0->MaxOutput=200;
> > > > > > ch0->DeadBandGain=1;
> > > > > > ch0->DeadBandRange=0;
> > > > > > ch0->InputChan0=2;
> > > > > > ch0->InputChan1=0;
> > > > > > ch0->OutputChan0=2;
> > > > > > ch0->OutputChan1=0;
> > > > > > ch0->MasterAxis=-1;
> > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > ch0->InputGain0=1;
> > > > > > ch0->InputGain1=1;
> > > > > > ch0->InputOffset0=0;
> > > > > > ch0->InputOffset1=0;
> > > > > > ch0->OutputGain=1;
> > > > > > ch0->OutputOffset=0;
> > > > > > ch0->SlaveGain=1;
> > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > ch0->BacklashAmount=0;
> > > > > > ch0->BacklashRate=0;
> > > > > > ch0->invDistPerCycle=1;
> > > > > > ch0->Lead=0;
> > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > ch0->StepperAmplitude=20;
> > > > > >
> > > > > > ch0->iir[0].B0=1;
> > > > > > ch0->iir[0].B1=0;
> > > > > > ch0->iir[0].B2=0;
> > > > > > ch0->iir[0].A1=0;
> > > > > > ch0->iir[0].A2=0;
> > > > > >
> > > > > > ch0->iir[1].B0=1;
> > > > > > ch0->iir[1].B1=0;
> > > > > > ch0->iir[1].B2=0;
> > > > > > ch0->iir[1].A1=0;
> > > > > > ch0->iir[1].A2=0;
> > > > > >
> > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > EnableAxisDest(0,0);
> > > > > >
> > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > ch1->Vel=40000;
> > > > > > ch1->Accel=400000;
> > > > > > ch1->Jerk=4000000;
> > > > > > ch1->P=0;
> > > > > > ch1->I=0.009999999776483;
> > > > > > ch1->D=0;
> > > > > > ch1->FFAccel=0;
> > > > > > ch1->FFVel=0;
> > > > > > ch1->MaxI=200;
> > > > > > ch1->MaxErr=1000000;
> > > > > > ch1->MaxOutput=200;
> > > > > > ch1->DeadBandGain=1;
> > > > > > ch1->DeadBandRange=0;
> > > > > > ch1->InputChan0=2;
> > > > > > ch1->InputChan1=0;
> > > > > > ch1->OutputChan0=2;
> > > > > > ch1->OutputChan1=0;
> > > > > > ch1->MasterAxis=-1;
> > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > ch1->InputGain0=1;
> > > > > > ch1->InputGain1=1;
> > > > > > ch1->InputOffset0=0;
> > > > > > ch1->InputOffset1=0;
> > > > > > ch1->OutputGain=1;
> > > > > > ch1->OutputOffset=0;
> > > > > > ch1->SlaveGain=1;
> > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > ch1->BacklashAmount=0;
> > > > > > ch1->BacklashRate=0;
> > > > > > ch1->invDistPerCycle=1;
> > > > > > ch1->Lead=0;
> > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > ch1->StepperAmplitude=20;
> > > > > >
> > > > > > ch1->iir[0].B0=1;
> > > > > > ch1->iir[0].B1=0;
> > > > > > ch1->iir[0].B2=0;
> > > > > > ch1->iir[0].A1=0;
> > > > > > ch1->iir[0].A2=0;
> > > > > >
> > > > > > ch1->iir[1].B0=1;
> > > > > > ch1->iir[1].B1=0;
> > > > > > ch1->iir[1].B2=0;
> > > > > > ch1->iir[1].A1=0;
> > > > > > ch1->iir[1].A2=0;
> > > > > >
> > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > EnableAxisDest(1,0);
> > > > > >
> > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > ch2->Vel=40000;
> > > > > > ch2->Accel=400000;
> > > > > > ch2->Jerk=4000000;
> > > > > > ch2->P=0;
> > > > > > ch2->I=0.009999999776483;
> > > > > > ch2->D=0;
> > > > > > ch2->FFAccel=0;
> > > > > > ch2->FFVel=0;
> > > > > > ch2->MaxI=200;
> > > > > > ch2->MaxErr=1000000;
> > > > > > ch2->MaxOutput=200;
> > > > > > ch2->DeadBandGain=1;
> > > > > > ch2->DeadBandRange=0;
> > > > > > ch2->InputChan0=0;
> > > > > > ch2->InputChan1=0;
> > > > > > ch2->OutputChan0=0;
> > > > > > ch2->OutputChan1=0;
> > > > > > ch2->MasterAxis=-1;
> > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > ch2->InputGain0=1;
> > > > > > ch2->InputGain1=1;
> > > > > > ch2->InputOffset0=0;
> > > > > > ch2->InputOffset1=0;
> > > > > > ch2->OutputGain=1;
> > > > > > ch2->OutputOffset=0;
> > > > > > ch2->SlaveGain=1;
> > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > ch2->BacklashAmount=0;
> > > > > > ch2->BacklashRate=0;
> > > > > > ch2->invDistPerCycle=1;
> > > > > > ch2->Lead=0;
> > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > ch2->StepperAmplitude=20;
> > > > > >
> > > > > > ch2->iir[0].B0=1;
> > > > > > ch2->iir[0].B1=0;
> > > > > > ch2->iir[0].B2=0;
> > > > > > ch2->iir[0].A1=0;
> > > > > > ch2->iir[0].A2=0;
> > > > > >
> > > > > > ch2->iir[1].B0=1;
> > > > > > ch2->iir[1].B1=0;
> > > > > > ch2->iir[1].B2=0;
> > > > > > ch2->iir[1].A1=0;
> > > > > > ch2->iir[1].A2=0;
> > > > > >
> > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > EnableAxisDest(2,0);
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > >
> > > > > > return 0;
> > > > > > }
> > > > > >
> > > > > > And this is the one for the home switches.
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > >
> > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > // Limit switches are disabled and used as a home switch
> > > > > > // then they are re-enabled
> > > > > >
> > > > > > main()
> > > > > > {
> > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > >
> > > > > > DisableAxis(0); // Disable all axes
> > > > > > DisableAxis(1);
> > > > > > DisableAxis(2);
> > > > > >
> > > > > > // Set the axis parameters here
> > > > > > // after everything is configured in the KMotion Screens
> > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > // then paste here. Repeat for each axis
> > > > > >
> > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > ch0->Vel=40000;
> > > > > > ch0->Accel=400000;
> > > > > > ch0->Jerk=4000000;
> > > > > > ch0->P=0;
> > > > > > ch0->I=0.009999999776483;
> > > > > > ch0->D=0;
> > > > > > ch0->FFAccel=0;
> > > > > > ch0->FFVel=0;
> > > > > > ch0->MaxI=200;
> > > > > > ch0->MaxErr=1000000;
> > > > > > ch0->MaxOutput=200;
> > > > > > ch0->DeadBandGain=1;
> > > > > > ch0->DeadBandRange=0;
> > > > > > ch0->InputChan0=2;
> > > > > > ch0->InputChan1=0;
> > > > > > ch0->OutputChan0=2;
> > > > > > ch0->OutputChan1=0;
> > > > > > ch0->MasterAxis=-1;
> > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > ch0->InputGain0=1;
> > > > > > ch0->InputGain1=1;
> > > > > > ch0->InputOffset0=0;
> > > > > > ch0->InputOffset1=0;
> > > > > > ch0->OutputGain=1;
> > > > > > ch0->OutputOffset=0;
> > > > > > ch0->SlaveGain=1;
> > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > ch0->BacklashAmount=0;
> > > > > > ch0->BacklashRate=0;
> > > > > > ch0->invDistPerCycle=1;
> > > > > > ch0->Lead=0;
> > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > ch0->StepperAmplitude=20;
> > > > > >
> > > > > > ch0->iir[0].B0=1;
> > > > > > ch0->iir[0].B1=0;
> > > > > > ch0->iir[0].B2=0;
> > > > > > ch0->iir[0].A1=0;
> > > > > > ch0->iir[0].A2=0;
> > > > > >
> > > > > > ch0->iir[1].B0=1;
> > > > > > ch0->iir[1].B1=0;
> > > > > > ch0->iir[1].B2=0;
> > > > > > ch0->iir[1].A1=0;
> > > > > > ch0->iir[1].A2=0;
> > > > > >
> > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > >
> > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > ch1->Vel=40000;
> > > > > > ch1->Accel=400000;
> > > > > > ch1->Jerk=4000000;
> > > > > > ch1->P=0;
> > > > > > ch1->I=0.009999999776483;
> > > > > > ch1->D=0;
> > > > > > ch1->FFAccel=0;
> > > > > > ch1->FFVel=0;
> > > > > > ch1->MaxI=200;
> > > > > > ch1->MaxErr=1000000;
> > > > > > ch1->MaxOutput=200;
> > > > > > ch1->DeadBandGain=1;
> > > > > > ch1->DeadBandRange=0;
> > > > > > ch1->InputChan0=2;
> > > > > > ch1->InputChan1=0;
> > > > > > ch1->OutputChan0=2;
> > > > > > ch1->OutputChan1=0;
> > > > > > ch1->MasterAxis=-1;
> > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > ch1->InputGain0=1;
> > > > > > ch1->InputGain1=1;
> > > > > > ch1->InputOffset0=0;
> > > > > > ch1->InputOffset1=0;
> > > > > > ch1->OutputGain=1;
> > > > > > ch1->OutputOffset=0;
> > > > > > ch1->SlaveGain=1;
> > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > ch1->BacklashAmount=0;
> > > > > > ch1->BacklashRate=0;
> > > > > > ch1->invDistPerCycle=1;
> > > > > > ch1->Lead=0;
> > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > ch1->StepperAmplitude=20;
> > > > > >
> > > > > > ch1->iir[0].B0=1;
> > > > > > ch1->iir[0].B1=0;
> > > > > > ch1->iir[0].B2=0;
> > > > > > ch1->iir[0].A1=0;
> > > > > > ch1->iir[0].A2=0;
> > > > > >
> > > > > > ch1->iir[1].B0=1;
> > > > > > ch1->iir[1].B1=0;
> > > > > > ch1->iir[1].B2=0;
> > > > > > ch1->iir[1].A1=0;
> > > > > > ch1->iir[1].A2=0;
> > > > > >
> > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > >
> > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > ch2->Vel=40000;
> > > > > > ch2->Accel=400000;
> > > > > > ch2->Jerk=4000000;
> > > > > > ch2->P=0;
> > > > > > ch2->I=0.009999999776483;
> > > > > > ch2->D=0;
> > > > > > ch2->FFAccel=0;
> > > > > > ch2->FFVel=0;
> > > > > > ch2->MaxI=200;
> > > > > > ch2->MaxErr=1000000;
> > > > > > ch2->MaxOutput=200;
> > > > > > ch2->DeadBandGain=1;
> > > > > > ch2->DeadBandRange=0;
> > > > > > ch2->InputChan0=0;
> > > > > > ch2->InputChan1=0;
> > > > > > ch2->OutputChan0=0;
> > > > > > ch2->OutputChan1=0;
> > > > > > ch2->MasterAxis=-1;
> > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > ch2->InputGain0=1;
> > > > > > ch2->InputGain1=1;
> > > > > > ch2->InputOffset0=0;
> > > > > > ch2->InputOffset1=0;
> > > > > > ch2->OutputGain=1;
> > > > > > ch2->OutputOffset=0;
> > > > > > ch2->SlaveGain=1;
> > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > ch2->BacklashAmount=0;
> > > > > > ch2->BacklashRate=0;
> > > > > > ch2->invDistPerCycle=1;
> > > > > > ch2->Lead=0;
> > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > ch2->StepperAmplitude=20;
> > > > > >
> > > > > > ch2->iir[0].B0=1;
> > > > > > ch2->iir[0].B1=0;
> > > > > > ch2->iir[0].B2=0;
> > > > > > ch2->iir[0].A1=0;
> > > > > > ch2->iir[0].A2=0;
> > > > > >
> > > > > > ch2->iir[1].B0=1;
> > > > > > ch2->iir[1].B1=0;
> > > > > > ch2->iir[1].B2=0;
> > > > > > ch2->iir[1].A1=0;
> > > > > > ch2->iir[1].A2=0;
> > > > > >
> > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > // disable the limits (first save how they were set)
> > > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > ch2->LimitSwitchOptions = 0;
> > > > > >
> > > > > > // enable all 3 axes and begin servoing where we are
> > > > > >
> > > > > > EnableAxis(0);
> > > > > > EnableAxis(1);
> > > > > > EnableAxis(2);
> > > > > >
> > > > > > // Home Z up first - jog until it sees the limit
> > > > > >
> > > > > > Jog(2,100); // jog slowly positive
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > Jog(2,0); // stop
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > DisableAxis(2); // disable the axis
> > > > > > Zero(2); // Zero the position
> > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > >
> > > > > > // Home X next - jog until it sees the limit
> > > > > >
> > > > > > Jog(0,-100); // jog slowly negative
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > Jog(0,0); // stop
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > DisableAxis(0); // disable the axis
> > > > > > Zero(0); // Zero the position
> > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > >
> > > > > > // Home Y next - jog until it sees the limit
> > > > > >
> > > > > > Jog(1,-100); // jog slowly negative
> > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > Jog(1,0); // stop
> > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > DisableAxis(1); // disable the axis
> > > > > > Zero(1); // Zero the position
> > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > }
> > > > > >
> > > > > > Thanks for all your help
> > > > > >
> > > > > > John
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Let's see:ÃÆ'Æ'‚ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'‚ÃÆ'‚  1mm /ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'‚ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'‚ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'Æ'‚ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'Æ'‚ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.ÃÆ'Æ'‚ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'Æ'‚ÃÆ'‚  All this information is packed into a 32bit hexadecimal LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'Æ'‚ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Regards
> > > > > > > TK
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi TK
> > > > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > > > What is the max I can run?(I'm a speed demon)
> > > > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > > > Thanks again
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > That's good progress.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one already?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Monday, June 20, 2011, 4:08 AM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi TK,
> > > > > > > >
> > > > > > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > > > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > > > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > > > > > Next question is the limit switches.
> > > > > > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > > > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > > > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > > > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > > > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > > > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > > > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > > > > > >
> > > > > > > > Thanks for your help we are getting there.
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Did you read the links I sent?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything directly.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C
> > program.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Regards
> > > > > > > > > TK
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi TK,
> > > > > > > > >
> > > > > > > > > Thanks for thr quick reply,
> > > > > > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > > > > > Thanks for your quick response.
> > > > > > > > >
> > > > > > > > > John
> > > > > > > > >
> > > > > > > > > --- In
(Message over 64 KB, truncated)
Group: DynoMotion Message: 1386 From: jonny1bar Date: 6/28/2011
Subject: Re: Newbe needs help
Hi Tom,

The home works fine when i run the c program, I understand what you mean about mach3 it seems to call the cprogram 3 times, is this because my home c program has all the home commands on one page?
Im sure you will come up with a solution.
we can move on to the limit issue when we sort the homing one thing at a time.

Thanks

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> Sorry about that. I sent a response last Saturday and I see it in my "sent" folder but somehow it wasn't posted.
>  
> here it is again...
>  
>  
>  
> Hi John,
>  
> Sorry I don't really understand your description.  It *should* stop homing when the switch is activated correct?   But it should not stop because of a limit fault.  Regardless of how limits are configured we are disabling limits while homing so I don't understand that comment either.
>  
> Let's just get Homing C program to work correctly first before trying to use Mach3.  As I described previously, Mach3 calls your Home.c program multiple times (once for each axis) so we need to add stuff to the C Program so it only homes the axis that Mach3 is requesting to be homed rather than all of them.
>  
> Unconnected and unused Inputs will float to random values.  This is normal.
>  
> Regards
> TK
>
> --- On Mon, 6/27/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Monday, June 27, 2011, 3:07 PM
>
>
>  
>
>
>
> Hi Tom
> Did you get a chance to look at my request
>
> John
>
> --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> >
> > Hi Tom
> > That worked perfectly thanks, I have a few more questions.
> > When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> > Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> > Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
> >
> > Thanks again
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > >  
> > >  
> > > Hi John,
> > >  
> > > The C language statement
> > >  
> > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > >
> > > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> > >  
> > > The " ! " is the NOT operator.  So remove the ! character for a home switch of the opposite polarity.
> > >  
> > >  
> > > Regarding the A Axis disabled.  There was a statement to declare X,Y,Z are used A unused:
> > >  
> > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > >
> > > I removed this statement from your Home Program because it should be in your Init program already.  Is it?  Do you have an Init program?
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > > --- On Sat, 6/25/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Saturday, June 25, 2011, 6:50 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi Tom,
> > >
> > > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > > What is the best way to sort this.
> > > Could we set the loop until IO bit goes high to low somehow.
> > > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
> > >
> > > Thanks
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > >
> > > > Hi Tom
> > > >
> > > > Ok I will try to work it out
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > >  
> > > > > See Attached
> > > > >  
> > > > > Software is very expensive :}
> > > > >  
> > > > > TK
> > > > >
> > > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Friday, June 24, 2011, 1:17 PM
> > > > >
> > > > >
> > > > >  
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Hi Tom
> > > > >
> > > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > > I am new to all this and need all the help I can get.
> > > > > I know of people that can help me but not sure how much it will cost.
> > > > > Thanks
> > > > >
> > > > > John
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'‚ 
> > > > > > The error is because you have a line of code to restore the Limit Switch Options but you neverÃÆ'‚ saved the options and a location to save them was never declared.ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > Are you using the same switch for homing and a limit?ÃÆ'‚  If you are then you need to:
> > > > > >
> > > > > > #1ÃÆ'‚ declare a place to save the original settings
> > > > > > ÃÆ'‚ ÃÆ'‚ ÃÆ'‚  Add an integer variable (inside the main function just after the bracket) with
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ ÃÆ'‚ ÃÆ'‚  int SaveZLimits;
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > #2 save them before homing
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ ÃÆ'‚  SaveZLimits = ch2->LimitSwitchOptions; //ÃÆ'‚ save original limit settings
> > > > > >
> > > > > > #3 disable the limits
> > > > > > ÃÆ'‚ 
> > > > > > ch2->LimitSwitchOptions = 0;ÃÆ'‚  // disable limits
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > #4 restore them (after homing)
> > > > > > ÃÆ'‚ 
> > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > Regards
> > > > > > TK
> > > > > > ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi Tom,
> > > > > >
> > > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > > If it works can i try it through mach3.
> > > > > > I have just worked out you can run the program from the c screen.
> > > > > > Were so close I can taste it.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > John
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > >
> > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > // Limit switches are disabled and used as a home switch
> > > > > > // then they are re-enabled
> > > > > >
> > > > > > main()
> > > > > > {
> > > > > >
> > > > > >
> > > > > > // enable all 3 axes and begin servoing where we are
> > > > > >
> > > > > > EnableAxis(0);
> > > > > > EnableAxis(1);
> > > > > > EnableAxis(2);
> > > > > >
> > > > > > // Home Z up first - jog until it sees the limit
> > > > > >
> > > > > > Jog(2,100); // jog slowly positive
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > Jog(2,0); // stop
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > DisableAxis(2); // disable the axis
> > > > > > Zero(2); // Zero the position
> > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > >
> > > > > > // Home X next - jog until it sees the limit
> > > > > >
> > > > > > Jog(0,-100); // jog slowly negative
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > Jog(0,0); // stop
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > DisableAxis(0); // disable the axis
> > > > > > Zero(0); // Zero the position
> > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > >
> > > > > > // Home Y next - jog until it sees the limit
> > > > > >
> > > > > > Jog(1,-100); // jog slowly negative
> > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > Jog(1,0); // stop
> > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > DisableAxis(1); // disable the axis
> > > > > > Zero(1); // Zero the position
> > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > }
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > The code looks reasonable to me.ÃÆ'Æ'‚ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > For Mach3 each axis is homed separately.ÃÆ'Æ'‚ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'Æ'‚ÃÆ'‚  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'Æ'‚ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'Æ'‚ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'Æ'‚ÃÆ'‚  See if that works.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Regards,
> > > > > > > TK
> > > > > > >
> > > > > > >
> > > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Tom,
> > > > > > >
> > > > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > > >
> > > > > > > Can you also have a quick look at axis C code
> > > > > > >
> > > > > > > #include "KMotionDef.h"
> > > > > > >
> > > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > > // enables them
> > > > > > > // sets them as an xyz coordinate system for GCode
> > > > > > >
> > > > > > > int main()
> > > > > > > {
> > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > ch0->Vel=40000;
> > > > > > > ch0->Accel=400000;
> > > > > > > ch0->Jerk=4000000;
> > > > > > > ch0->P=0;
> > > > > > > ch0->I=0.009999999776483;
> > > > > > > ch0->D=0;
> > > > > > > ch0->FFAccel=0;
> > > > > > > ch0->FFVel=0;
> > > > > > > ch0->MaxI=200;
> > > > > > > ch0->MaxErr=1000000;
> > > > > > > ch0->MaxOutput=200;
> > > > > > > ch0->DeadBandGain=1;
> > > > > > > ch0->DeadBandRange=0;
> > > > > > > ch0->InputChan0=2;
> > > > > > > ch0->InputChan1=0;
> > > > > > > ch0->OutputChan0=2;
> > > > > > > ch0->OutputChan1=0;
> > > > > > > ch0->MasterAxis=-1;
> > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > ch0->InputGain0=1;
> > > > > > > ch0->InputGain1=1;
> > > > > > > ch0->InputOffset0=0;
> > > > > > > ch0->InputOffset1=0;
> > > > > > > ch0->OutputGain=1;
> > > > > > > ch0->OutputOffset=0;
> > > > > > > ch0->SlaveGain=1;
> > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > ch0->BacklashAmount=0;
> > > > > > > ch0->BacklashRate=0;
> > > > > > > ch0->invDistPerCycle=1;
> > > > > > > ch0->Lead=0;
> > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > ch0->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch0->iir[0].B0=1;
> > > > > > > ch0->iir[0].B1=0;
> > > > > > > ch0->iir[0].B2=0;
> > > > > > > ch0->iir[0].A1=0;
> > > > > > > ch0->iir[0].A2=0;
> > > > > > >
> > > > > > > ch0->iir[1].B0=1;
> > > > > > > ch0->iir[1].B1=0;
> > > > > > > ch0->iir[1].B2=0;
> > > > > > > ch0->iir[1].A1=0;
> > > > > > > ch0->iir[1].A2=0;
> > > > > > >
> > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > EnableAxisDest(0,0);
> > > > > > >
> > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > ch1->Vel=40000;
> > > > > > > ch1->Accel=400000;
> > > > > > > ch1->Jerk=4000000;
> > > > > > > ch1->P=0;
> > > > > > > ch1->I=0.009999999776483;
> > > > > > > ch1->D=0;
> > > > > > > ch1->FFAccel=0;
> > > > > > > ch1->FFVel=0;
> > > > > > > ch1->MaxI=200;
> > > > > > > ch1->MaxErr=1000000;
> > > > > > > ch1->MaxOutput=200;
> > > > > > > ch1->DeadBandGain=1;
> > > > > > > ch1->DeadBandRange=0;
> > > > > > > ch1->InputChan0=2;
> > > > > > > ch1->InputChan1=0;
> > > > > > > ch1->OutputChan0=2;
> > > > > > > ch1->OutputChan1=0;
> > > > > > > ch1->MasterAxis=-1;
> > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > ch1->InputGain0=1;
> > > > > > > ch1->InputGain1=1;
> > > > > > > ch1->InputOffset0=0;
> > > > > > > ch1->InputOffset1=0;
> > > > > > > ch1->OutputGain=1;
> > > > > > > ch1->OutputOffset=0;
> > > > > > > ch1->SlaveGain=1;
> > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > ch1->BacklashAmount=0;
> > > > > > > ch1->BacklashRate=0;
> > > > > > > ch1->invDistPerCycle=1;
> > > > > > > ch1->Lead=0;
> > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > ch1->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch1->iir[0].B0=1;
> > > > > > > ch1->iir[0].B1=0;
> > > > > > > ch1->iir[0].B2=0;
> > > > > > > ch1->iir[0].A1=0;
> > > > > > > ch1->iir[0].A2=0;
> > > > > > >
> > > > > > > ch1->iir[1].B0=1;
> > > > > > > ch1->iir[1].B1=0;
> > > > > > > ch1->iir[1].B2=0;
> > > > > > > ch1->iir[1].A1=0;
> > > > > > > ch1->iir[1].A2=0;
> > > > > > >
> > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > EnableAxisDest(1,0);
> > > > > > >
> > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > ch2->Vel=40000;
> > > > > > > ch2->Accel=400000;
> > > > > > > ch2->Jerk=4000000;
> > > > > > > ch2->P=0;
> > > > > > > ch2->I=0.009999999776483;
> > > > > > > ch2->D=0;
> > > > > > > ch2->FFAccel=0;
> > > > > > > ch2->FFVel=0;
> > > > > > > ch2->MaxI=200;
> > > > > > > ch2->MaxErr=1000000;
> > > > > > > ch2->MaxOutput=200;
> > > > > > > ch2->DeadBandGain=1;
> > > > > > > ch2->DeadBandRange=0;
> > > > > > > ch2->InputChan0=0;
> > > > > > > ch2->InputChan1=0;
> > > > > > > ch2->OutputChan0=0;
> > > > > > > ch2->OutputChan1=0;
> > > > > > > ch2->MasterAxis=-1;
> > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > ch2->InputGain0=1;
> > > > > > > ch2->InputGain1=1;
> > > > > > > ch2->InputOffset0=0;
> > > > > > > ch2->InputOffset1=0;
> > > > > > > ch2->OutputGain=1;
> > > > > > > ch2->OutputOffset=0;
> > > > > > > ch2->SlaveGain=1;
> > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > ch2->BacklashAmount=0;
> > > > > > > ch2->BacklashRate=0;
> > > > > > > ch2->invDistPerCycle=1;
> > > > > > > ch2->Lead=0;
> > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > ch2->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch2->iir[0].B0=1;
> > > > > > > ch2->iir[0].B1=0;
> > > > > > > ch2->iir[0].B2=0;
> > > > > > > ch2->iir[0].A1=0;
> > > > > > > ch2->iir[0].A2=0;
> > > > > > >
> > > > > > > ch2->iir[1].B0=1;
> > > > > > > ch2->iir[1].B1=0;
> > > > > > > ch2->iir[1].B2=0;
> > > > > > > ch2->iir[1].A1=0;
> > > > > > > ch2->iir[1].A2=0;
> > > > > > >
> > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > EnableAxisDest(2,0);
> > > > > > >
> > > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > > >
> > > > > > > return 0;
> > > > > > > }
> > > > > > >
> > > > > > > And this is the one for the home switches.
> > > > > > >
> > > > > > > #include "KMotionDef.h"
> > > > > > >
> > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > // then they are re-enabled
> > > > > > >
> > > > > > > main()
> > > > > > > {
> > > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > > >
> > > > > > > DisableAxis(0); // Disable all axes
> > > > > > > DisableAxis(1);
> > > > > > > DisableAxis(2);
> > > > > > >
> > > > > > > // Set the axis parameters here
> > > > > > > // after everything is configured in the KMotion Screens
> > > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > > // then paste here. Repeat for each axis
> > > > > > >
> > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > ch0->Vel=40000;
> > > > > > > ch0->Accel=400000;
> > > > > > > ch0->Jerk=4000000;
> > > > > > > ch0->P=0;
> > > > > > > ch0->I=0.009999999776483;
> > > > > > > ch0->D=0;
> > > > > > > ch0->FFAccel=0;
> > > > > > > ch0->FFVel=0;
> > > > > > > ch0->MaxI=200;
> > > > > > > ch0->MaxErr=1000000;
> > > > > > > ch0->MaxOutput=200;
> > > > > > > ch0->DeadBandGain=1;
> > > > > > > ch0->DeadBandRange=0;
> > > > > > > ch0->InputChan0=2;
> > > > > > > ch0->InputChan1=0;
> > > > > > > ch0->OutputChan0=2;
> > > > > > > ch0->OutputChan1=0;
> > > > > > > ch0->MasterAxis=-1;
> > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > ch0->InputGain0=1;
> > > > > > > ch0->InputGain1=1;
> > > > > > > ch0->InputOffset0=0;
> > > > > > > ch0->InputOffset1=0;
> > > > > > > ch0->OutputGain=1;
> > > > > > > ch0->OutputOffset=0;
> > > > > > > ch0->SlaveGain=1;
> > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > ch0->BacklashAmount=0;
> > > > > > > ch0->BacklashRate=0;
> > > > > > > ch0->invDistPerCycle=1;
> > > > > > > ch0->Lead=0;
> > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > ch0->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch0->iir[0].B0=1;
> > > > > > > ch0->iir[0].B1=0;
> > > > > > > ch0->iir[0].B2=0;
> > > > > > > ch0->iir[0].A1=0;
> > > > > > > ch0->iir[0].A2=0;
> > > > > > >
> > > > > > > ch0->iir[1].B0=1;
> > > > > > > ch0->iir[1].B1=0;
> > > > > > > ch0->iir[1].B2=0;
> > > > > > > ch0->iir[1].A1=0;
> > > > > > > ch0->iir[1].A2=0;
> > > > > > >
> > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > >
> > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > ch1->Vel=40000;
> > > > > > > ch1->Accel=400000;
> > > > > > > ch1->Jerk=4000000;
> > > > > > > ch1->P=0;
> > > > > > > ch1->I=0.009999999776483;
> > > > > > > ch1->D=0;
> > > > > > > ch1->FFAccel=0;
> > > > > > > ch1->FFVel=0;
> > > > > > > ch1->MaxI=200;
> > > > > > > ch1->MaxErr=1000000;
> > > > > > > ch1->MaxOutput=200;
> > > > > > > ch1->DeadBandGain=1;
> > > > > > > ch1->DeadBandRange=0;
> > > > > > > ch1->InputChan0=2;
> > > > > > > ch1->InputChan1=0;
> > > > > > > ch1->OutputChan0=2;
> > > > > > > ch1->OutputChan1=0;
> > > > > > > ch1->MasterAxis=-1;
> > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > ch1->InputGain0=1;
> > > > > > > ch1->InputGain1=1;
> > > > > > > ch1->InputOffset0=0;
> > > > > > > ch1->InputOffset1=0;
> > > > > > > ch1->OutputGain=1;
> > > > > > > ch1->OutputOffset=0;
> > > > > > > ch1->SlaveGain=1;
> > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > ch1->BacklashAmount=0;
> > > > > > > ch1->BacklashRate=0;
> > > > > > > ch1->invDistPerCycle=1;
> > > > > > > ch1->Lead=0;
> > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > ch1->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch1->iir[0].B0=1;
> > > > > > > ch1->iir[0].B1=0;
> > > > > > > ch1->iir[0].B2=0;
> > > > > > > ch1->iir[0].A1=0;
> > > > > > > ch1->iir[0].A2=0;
> > > > > > >
> > > > > > > ch1->iir[1].B0=1;
> > > > > > > ch1->iir[1].B1=0;
> > > > > > > ch1->iir[1].B2=0;
> > > > > > > ch1->iir[1].A1=0;
> > > > > > > ch1->iir[1].A2=0;
> > > > > > >
> > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > >
> > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > ch2->Vel=40000;
> > > > > > > ch2->Accel=400000;
> > > > > > > ch2->Jerk=4000000;
> > > > > > > ch2->P=0;
> > > > > > > ch2->I=0.009999999776483;
> > > > > > > ch2->D=0;
> > > > > > > ch2->FFAccel=0;
> > > > > > > ch2->FFVel=0;
> > > > > > > ch2->MaxI=200;
> > > > > > > ch2->MaxErr=1000000;
> > > > > > > ch2->MaxOutput=200;
> > > > > > > ch2->DeadBandGain=1;
> > > > > > > ch2->DeadBandRange=0;
> > > > > > > ch2->InputChan0=0;
> > > > > > > ch2->InputChan1=0;
> > > > > > > ch2->OutputChan0=0;
> > > > > > > ch2->OutputChan1=0;
> > > > > > > ch2->MasterAxis=-1;
> > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > ch2->InputGain0=1;
> > > > > > > ch2->InputGain1=1;
> > > > > > > ch2->InputOffset0=0;
> > > > > > > ch2->InputOffset1=0;
> > > > > > > ch2->OutputGain=1;
> > > > > > > ch2->OutputOffset=0;
> > > > > > > ch2->SlaveGain=1;
> > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > ch2->BacklashAmount=0;
> > > > > > > ch2->BacklashRate=0;
> > > > > > > ch2->invDistPerCycle=1;
> > > > > > > ch2->Lead=0;
> > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > ch2->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch2->iir[0].B0=1;
> > > > > > > ch2->iir[0].B1=0;
> > > > > > > ch2->iir[0].B2=0;
> > > > > > > ch2->iir[0].A1=0;
> > > > > > > ch2->iir[0].A2=0;
> > > > > > >
> > > > > > > ch2->iir[1].B0=1;
> > > > > > > ch2->iir[1].B1=0;
> > > > > > > ch2->iir[1].B2=0;
> > > > > > > ch2->iir[1].A1=0;
> > > > > > > ch2->iir[1].A2=0;
> > > > > > >
> > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > // disable the limits (first save how they were set)
> > > > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > > ch2->LimitSwitchOptions = 0;
> > > > > > >
> > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > >
> > > > > > > EnableAxis(0);
> > > > > > > EnableAxis(1);
> > > > > > > EnableAxis(2);
> > > > > > >
> > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(2,0); // stop
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > DisableAxis(2); // disable the axis
> > > > > > > Zero(2); // Zero the position
> > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home X next - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(0,0); // stop
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > DisableAxis(0); // disable the axis
> > > > > > > Zero(0); // Zero the position
> > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home Y next - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > Jog(1,0); // stop
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > DisableAxis(1); // disable the axis
> > > > > > > Zero(1); // Zero the position
> > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > >
> > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > }
> > > > > > >
> > > > > > > Thanks for all your help
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Let's see:ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  1mm /ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  All this information is packed into a 32bit hexadecimal
> LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi TK
> > > > > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > > > > What is the max I can run?(I'm a speed demon)
> > > > > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > > > > Thanks again
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > That's good progress.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one already?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Regards
> > > > > > > > > TK
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Date: Monday, June 20, 2011, 4:08 AM
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi TK,
> > > > > > > > >
> > > > > > > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > > > > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > > > > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > > > > > > Next question is the limit switches.
> > > > > > > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > > > > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > > > > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > > > > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > > > > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > > > > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > > > > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > > > > > > >
> > > > > > > > > Thanks for your help we are getting there.
> > > > > > > > >
> > > > > > > > > John
> > > > > > > > >
> > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > >
> > > > > > > > > > Hi John,
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > Did you read the links I sent?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board button.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything
> directly.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C
> > > program.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > Regards
> > > > > > > > > > TK
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi TK,
> > > > > > > > > >
> > > > > > > > > > Thanks for thr quick reply,
> > > > > > > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > > > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > > > > > > Thanks for your quick response.
> > > > > > > > > >
> > > > > > > > > > John
> > > > > > > > > >
> > > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hi John,
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion
> ProgramÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > Also before using KMotionCNC or Mach3 the GCode Variables X,Y,Z,AÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C
> LanguageÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ function
> > > callÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ such
> asÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ DefineCoordSystem(0,1,2,-1);
> > > > > > > > > > >
> > > > > > > > > > > For a general description of the various ways parameters in KFLOP can be configured see:
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > For help on converting your parameter setting automatically to C code see step :
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > http://www.dynomotion.com/Help/Mach3Plugin/Mach3.htm
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > HTH
> > > > > > > > > > > TK
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > > > Subject: [DynoMotion] Newbe needs help
> > > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > > Date: Sunday, June 19, 2011, 9:46 AM
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Hi All,
> > > > > > > > > > >
> > > > > > > > > > > Im new to the Kflop board just got it out today for play.
> > > > > > > > > > > I have managed to install the software and wire up a stepper motor.
> > > > > > > > > > > I have also loaded the simplestepdiraxis0.mot in the config screen, then pressed the move button in the step response screen and guess what it moved.
> > > > > > > > > > > Now i havent got a clue what to do next, how can I make the motor move by jogging with the keys or a G code command.
> > > > > > > > > > > I loaded the Kmotioncnc and tried to jog but nothing.
> > > > > > > > > > >
> > > > > > > > > > > Thanks
> > > > > > > > > > >
> > > > > > > > > > > John
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 1387 From: Tom Kerekes Date: 6/28/2011
Subject: Re: Newbe needs help
Hi John,
 
ok great.  That is correct.  You need to now change the program so it only does the axis it is told to do by Mach3.
 
Open the HomeMach3 example.
 
Copy and paste the code that homes your x axis into the place marked: 
 
// do X homing here. 
 
Same for Y and Z
 
Regards
TK

--- On Tue, 6/28/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Tuesday, June 28, 2011, 10:25 AM

 
Hi Tom,

The home works fine when i run the c program, I understand what you mean about mach3 it seems to call the cprogram 3 times, is this because my home c program has all the home commands on one page?
Im sure you will come up with a solution.
we can move on to the limit issue when we sort the homing one thing at a time.

Thanks

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> Sorry about that. I sent a response last Saturday and I see it in my "sent" folder but somehow it wasn't posted.
>  
> here it is again...
>  
>  
>  
> Hi John,
>  
> Sorry I don't really understand your description.  It *should* stop homing when the switch is activated correct?   But it should not stop because of a limit fault.  Regardless of how limits are configured we are disabling limits while homing so I don't understand that comment either.
>  
> Let's just get Homing C program to work correctly first before trying to use Mach3.  As I described previously, Mach3 calls your Home.c program multiple times (once for each axis) so we need to add stuff to the C Program so it only homes the axis that Mach3 is requesting to be homed rather than all of them.
>  
> Unconnected and unused Inputs will float to random values.  This is normal.
>  
> Regards
> TK
>
> --- On Mon, 6/27/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Monday, June 27, 2011, 3:07 PM
>
>
>  
>
>
>
> Hi Tom
> Did you get a chance to look at my request
>
> John
>
> --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> >
> > Hi Tom
> > That worked perfectly thanks, I have a few more questions.
> > When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> > Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> > Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
> >
> > Thanks again
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > >  
> > >  
> > > Hi John,
> > >  
> > > The C language statement
> > >  
> > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > >
> > > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> > >  
> > > The " ! " is the NOT operator.  So remove the ! character for a home switch of the opposite polarity.
> > >  
> > >  
> > > Regarding the A Axis disabled.  There was a statement to declare X,Y,Z are used A unused:
> > >  
> > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > >
> > > I removed this statement from your Home Program because it should be in your Init program already.  Is it?  Do you have an Init program?
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > > --- On Sat, 6/25/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Saturday, June 25, 2011, 6:50 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi Tom,
> > >
> > > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > > What is the best way to sort this.
> > > Could we set the loop until IO bit goes high to low somehow.
> > > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
> > >
> > > Thanks
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > >
> > > > Hi Tom
> > > >
> > > > Ok I will try to work it out
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi John,
> > > > >  
> > > > > See Attached
> > > > >  
> > > > > Software is very expensive :}
> > > > >  
> > > > > TK
> > > > >
> > > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Friday, June 24, 2011, 1:17 PM
> > > > >
> > > > >
> > > > >  
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Hi Tom
> > > > >
> > > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > > I am new to all this and need all the help I can get.
> > > > > I know of people that can help me but not sure how much it will cost.
> > > > > Thanks
> > > > >
> > > > > John
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'‚ 
> > > > > > The error is because you have a line of code to restore the Limit Switch Options but you neverÃÆ'‚ saved the options and a location to save them was never declared.ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > Are you using the same switch for homing and a limit?ÃÆ'‚  If you are then you need to:
> > > > > >
> > > > > > #1ÃÆ'‚ declare a place to save the original settings
> > > > > > ÃÆ'‚ ÃÆ'‚ ÃÆ'‚  Add an integer variable (inside the main function just after the bracket) with
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ ÃÆ'‚ ÃÆ'‚  int SaveZLimits;
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > #2 save them before homing
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ ÃÆ'‚  SaveZLimits = ch2->LimitSwitchOptions; //ÃÆ'‚ save original limit settings
> > > > > >
> > > > > > #3 disable the limits
> > > > > > ÃÆ'‚ 
> > > > > > ch2->LimitSwitchOptions = 0;ÃÆ'‚  // disable limits
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > #4 restore them (after homing)
> > > > > > ÃÆ'‚ 
> > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > > > ÃÆ'‚ 
> > > > > > ÃÆ'‚ 
> > > > > > Regards
> > > > > > TK
> > > > > > ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi Tom,
> > > > > >
> > > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > > If it works can i try it through mach3.
> > > > > > I have just worked out you can run the program from the c screen.
> > > > > > Were so close I can taste it.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > John
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > >
> > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > // Limit switches are disabled and used as a home switch
> > > > > > // then they are re-enabled
> > > > > >
> > > > > > main()
> > > > > > {
> > > > > >
> > > > > >
> > > > > > // enable all 3 axes and begin servoing where we are
> > > > > >
> > > > > > EnableAxis(0);
> > > > > > EnableAxis(1);
> > > > > > EnableAxis(2);
> > > > > >
> > > > > > // Home Z up first - jog until it sees the limit
> > > > > >
> > > > > > Jog(2,100); // jog slowly positive
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > Jog(2,0); // stop
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > DisableAxis(2); // disable the axis
> > > > > > Zero(2); // Zero the position
> > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > >
> > > > > > // Home X next - jog until it sees the limit
> > > > > >
> > > > > > Jog(0,-100); // jog slowly negative
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > Jog(0,0); // stop
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > DisableAxis(0); // disable the axis
> > > > > > Zero(0); // Zero the position
> > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > >
> > > > > > // Home Y next - jog until it sees the limit
> > > > > >
> > > > > > Jog(1,-100); // jog slowly negative
> > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > Jog(1,0); // stop
> > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > DisableAxis(1); // disable the axis
> > > > > > Zero(1); // Zero the position
> > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > }
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > The code looks reasonable to me.ÃÆ'Æ'‚ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > For Mach3 each axis is homed separately.ÃÆ'Æ'‚ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'Æ'‚ÃÆ'‚  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'Æ'‚ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'Æ'‚ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'Æ'‚ÃÆ'‚  See if that works.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Regards,
> > > > > > > TK
> > > > > > >
> > > > > > >
> > > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Tom,
> > > > > > >
> > > > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > > >
> > > > > > > Can you also have a quick look at axis C code
> > > > > > >
> > > > > > > #include "KMotionDef.h"
> > > > > > >
> > > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > > // enables them
> > > > > > > // sets them as an xyz coordinate system for GCode
> > > > > > >
> > > > > > > int main()
> > > > > > > {
> > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > ch0->Vel=40000;
> > > > > > > ch0->Accel=400000;
> > > > > > > ch0->Jerk=4000000;
> > > > > > > ch0->P=0;
> > > > > > > ch0->I=0.009999999776483;
> > > > > > > ch0->D=0;
> > > > > > > ch0->FFAccel=0;
> > > > > > > ch0->FFVel=0;
> > > > > > > ch0->MaxI=200;
> > > > > > > ch0->MaxErr=1000000;
> > > > > > > ch0->MaxOutput=200;
> > > > > > > ch0->DeadBandGain=1;
> > > > > > > ch0->DeadBandRange=0;
> > > > > > > ch0->InputChan0=2;
> > > > > > > ch0->InputChan1=0;
> > > > > > > ch0->OutputChan0=2;
> > > > > > > ch0->OutputChan1=0;
> > > > > > > ch0->MasterAxis=-1;
> > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > ch0->InputGain0=1;
> > > > > > > ch0->InputGain1=1;
> > > > > > > ch0->InputOffset0=0;
> > > > > > > ch0->InputOffset1=0;
> > > > > > > ch0->OutputGain=1;
> > > > > > > ch0->OutputOffset=0;
> > > > > > > ch0->SlaveGain=1;
> > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > ch0->BacklashAmount=0;
> > > > > > > ch0->BacklashRate=0;
> > > > > > > ch0->invDistPerCycle=1;
> > > > > > > ch0->Lead=0;
> > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > ch0->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch0->iir[0].B0=1;
> > > > > > > ch0->iir[0].B1=0;
> > > > > > > ch0->iir[0].B2=0;
> > > > > > > ch0->iir[0].A1=0;
> > > > > > > ch0->iir[0].A2=0;
> > > > > > >
> > > > > > > ch0->iir[1].B0=1;
> > > > > > > ch0->iir[1].B1=0;
> > > > > > > ch0->iir[1].B2=0;
> > > > > > > ch0->iir[1].A1=0;
> > > > > > > ch0->iir[1].A2=0;
> > > > > > >
> > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > EnableAxisDest(0,0);
> > > > > > >
> > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > ch1->Vel=40000;
> > > > > > > ch1->Accel=400000;
> > > > > > > ch1->Jerk=4000000;
> > > > > > > ch1->P=0;
> > > > > > > ch1->I=0.009999999776483;
> > > > > > > ch1->D=0;
> > > > > > > ch1->FFAccel=0;
> > > > > > > ch1->FFVel=0;
> > > > > > > ch1->MaxI=200;
> > > > > > > ch1->MaxErr=1000000;
> > > > > > > ch1->MaxOutput=200;
> > > > > > > ch1->DeadBandGain=1;
> > > > > > > ch1->DeadBandRange=0;
> > > > > > > ch1->InputChan0=2;
> > > > > > > ch1->InputChan1=0;
> > > > > > > ch1->OutputChan0=2;
> > > > > > > ch1->OutputChan1=0;
> > > > > > > ch1->MasterAxis=-1;
> > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > ch1->InputGain0=1;
> > > > > > > ch1->InputGain1=1;
> > > > > > > ch1->InputOffset0=0;
> > > > > > > ch1->InputOffset1=0;
> > > > > > > ch1->OutputGain=1;
> > > > > > > ch1->OutputOffset=0;
> > > > > > > ch1->SlaveGain=1;
> > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > ch1->BacklashAmount=0;
> > > > > > > ch1->BacklashRate=0;
> > > > > > > ch1->invDistPerCycle=1;
> > > > > > > ch1->Lead=0;
> > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > ch1->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch1->iir[0].B0=1;
> > > > > > > ch1->iir[0].B1=0;
> > > > > > > ch1->iir[0].B2=0;
> > > > > > > ch1->iir[0].A1=0;
> > > > > > > ch1->iir[0].A2=0;
> > > > > > >
> > > > > > > ch1->iir[1].B0=1;
> > > > > > > ch1->iir[1].B1=0;
> > > > > > > ch1->iir[1].B2=0;
> > > > > > > ch1->iir[1].A1=0;
> > > > > > > ch1->iir[1].A2=0;
> > > > > > >
> > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > EnableAxisDest(1,0);
> > > > > > >
> > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > ch2->Vel=40000;
> > > > > > > ch2->Accel=400000;
> > > > > > > ch2->Jerk=4000000;
> > > > > > > ch2->P=0;
> > > > > > > ch2->I=0.009999999776483;
> > > > > > > ch2->D=0;
> > > > > > > ch2->FFAccel=0;
> > > > > > > ch2->FFVel=0;
> > > > > > > ch2->MaxI=200;
> > > > > > > ch2->MaxErr=1000000;
> > > > > > > ch2->MaxOutput=200;
> > > > > > > ch2->DeadBandGain=1;
> > > > > > > ch2->DeadBandRange=0;
> > > > > > > ch2->InputChan0=0;
> > > > > > > ch2->InputChan1=0;
> > > > > > > ch2->OutputChan0=0;
> > > > > > > ch2->OutputChan1=0;
> > > > > > > ch2->MasterAxis=-1;
> > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > ch2->InputGain0=1;
> > > > > > > ch2->InputGain1=1;
> > > > > > > ch2->InputOffset0=0;
> > > > > > > ch2->InputOffset1=0;
> > > > > > > ch2->OutputGain=1;
> > > > > > > ch2->OutputOffset=0;
> > > > > > > ch2->SlaveGain=1;
> > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > ch2->BacklashAmount=0;
> > > > > > > ch2->BacklashRate=0;
> > > > > > > ch2->invDistPerCycle=1;
> > > > > > > ch2->Lead=0;
> > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > ch2->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch2->iir[0].B0=1;
> > > > > > > ch2->iir[0].B1=0;
> > > > > > > ch2->iir[0].B2=0;
> > > > > > > ch2->iir[0].A1=0;
> > > > > > > ch2->iir[0].A2=0;
> > > > > > >
> > > > > > > ch2->iir[1].B0=1;
> > > > > > > ch2->iir[1].B1=0;
> > > > > > > ch2->iir[1].B2=0;
> > > > > > > ch2->iir[1].A1=0;
> > > > > > > ch2->iir[1].A2=0;
> > > > > > >
> > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > EnableAxisDest(2,0);
> > > > > > >
> > > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > > >
> > > > > > > return 0;
> > > > > > > }
> > > > > > >
> > > > > > > And this is the one for the home switches.
> > > > > > >
> > > > > > > #include "KMotionDef.h"
> > > > > > >
> > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > // then they are re-enabled
> > > > > > >
> > > > > > > main()
> > > > > > > {
> > > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > > >
> > > > > > > DisableAxis(0); // Disable all axes
> > > > > > > DisableAxis(1);
> > > > > > > DisableAxis(2);
> > > > > > >
> > > > > > > // Set the axis parameters here
> > > > > > > // after everything is configured in the KMotion Screens
> > > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > > // then paste here. Repeat for each axis
> > > > > > >
> > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > ch0->Vel=40000;
> > > > > > > ch0->Accel=400000;
> > > > > > > ch0->Jerk=4000000;
> > > > > > > ch0->P=0;
> > > > > > > ch0->I=0.009999999776483;
> > > > > > > ch0->D=0;
> > > > > > > ch0->FFAccel=0;
> > > > > > > ch0->FFVel=0;
> > > > > > > ch0->MaxI=200;
> > > > > > > ch0->MaxErr=1000000;
> > > > > > > ch0->MaxOutput=200;
> > > > > > > ch0->DeadBandGain=1;
> > > > > > > ch0->DeadBandRange=0;
> > > > > > > ch0->InputChan0=2;
> > > > > > > ch0->InputChan1=0;
> > > > > > > ch0->OutputChan0=2;
> > > > > > > ch0->OutputChan1=0;
> > > > > > > ch0->MasterAxis=-1;
> > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > ch0->InputGain0=1;
> > > > > > > ch0->InputGain1=1;
> > > > > > > ch0->InputOffset0=0;
> > > > > > > ch0->InputOffset1=0;
> > > > > > > ch0->OutputGain=1;
> > > > > > > ch0->OutputOffset=0;
> > > > > > > ch0->SlaveGain=1;
> > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > ch0->BacklashAmount=0;
> > > > > > > ch0->BacklashRate=0;
> > > > > > > ch0->invDistPerCycle=1;
> > > > > > > ch0->Lead=0;
> > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > ch0->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch0->iir[0].B0=1;
> > > > > > > ch0->iir[0].B1=0;
> > > > > > > ch0->iir[0].B2=0;
> > > > > > > ch0->iir[0].A1=0;
> > > > > > > ch0->iir[0].A2=0;
> > > > > > >
> > > > > > > ch0->iir[1].B0=1;
> > > > > > > ch0->iir[1].B1=0;
> > > > > > > ch0->iir[1].B2=0;
> > > > > > > ch0->iir[1].A1=0;
> > > > > > > ch0->iir[1].A2=0;
> > > > > > >
> > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > >
> > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > ch1->Vel=40000;
> > > > > > > ch1->Accel=400000;
> > > > > > > ch1->Jerk=4000000;
> > > > > > > ch1->P=0;
> > > > > > > ch1->I=0.009999999776483;
> > > > > > > ch1->D=0;
> > > > > > > ch1->FFAccel=0;
> > > > > > > ch1->FFVel=0;
> > > > > > > ch1->MaxI=200;
> > > > > > > ch1->MaxErr=1000000;
> > > > > > > ch1->MaxOutput=200;
> > > > > > > ch1->DeadBandGain=1;
> > > > > > > ch1->DeadBandRange=0;
> > > > > > > ch1->InputChan0=2;
> > > > > > > ch1->InputChan1=0;
> > > > > > > ch1->OutputChan0=2;
> > > > > > > ch1->OutputChan1=0;
> > > > > > > ch1->MasterAxis=-1;
> > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > ch1->InputGain0=1;
> > > > > > > ch1->InputGain1=1;
> > > > > > > ch1->InputOffset0=0;
> > > > > > > ch1->InputOffset1=0;
> > > > > > > ch1->OutputGain=1;
> > > > > > > ch1->OutputOffset=0;
> > > > > > > ch1->SlaveGain=1;
> > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > ch1->BacklashAmount=0;
> > > > > > > ch1->BacklashRate=0;
> > > > > > > ch1->invDistPerCycle=1;
> > > > > > > ch1->Lead=0;
> > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > ch1->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch1->iir[0].B0=1;
> > > > > > > ch1->iir[0].B1=0;
> > > > > > > ch1->iir[0].B2=0;
> > > > > > > ch1->iir[0].A1=0;
> > > > > > > ch1->iir[0].A2=0;
> > > > > > >
> > > > > > > ch1->iir[1].B0=1;
> > > > > > > ch1->iir[1].B1=0;
> > > > > > > ch1->iir[1].B2=0;
> > > > > > > ch1->iir[1].A1=0;
> > > > > > > ch1->iir[1].A2=0;
> > > > > > >
> > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > >
> > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > ch2->Vel=40000;
> > > > > > > ch2->Accel=400000;
> > > > > > > ch2->Jerk=4000000;
> > > > > > > ch2->P=0;
> > > > > > > ch2->I=0.009999999776483;
> > > > > > > ch2->D=0;
> > > > > > > ch2->FFAccel=0;
> > > > > > > ch2->FFVel=0;
> > > > > > > ch2->MaxI=200;
> > > > > > > ch2->MaxErr=1000000;
> > > > > > > ch2->MaxOutput=200;
> > > > > > > ch2->DeadBandGain=1;
> > > > > > > ch2->DeadBandRange=0;
> > > > > > > ch2->InputChan0=0;
> > > > > > > ch2->InputChan1=0;
> > > > > > > ch2->OutputChan0=0;
> > > > > > > ch2->OutputChan1=0;
> > > > > > > ch2->MasterAxis=-1;
> > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > ch2->InputGain0=1;
> > > > > > > ch2->InputGain1=1;
> > > > > > > ch2->InputOffset0=0;
> > > > > > > ch2->InputOffset1=0;
> > > > > > > ch2->OutputGain=1;
> > > > > > > ch2->OutputOffset=0;
> > > > > > > ch2->SlaveGain=1;
> > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > ch2->BacklashAmount=0;
> > > > > > > ch2->BacklashRate=0;
> > > > > > > ch2->invDistPerCycle=1;
> > > > > > > ch2->Lead=0;
> > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > ch2->StepperAmplitude=20;
> > > > > > >
> > > > > > > ch2->iir[0].B0=1;
> > > > > > > ch2->iir[0].B1=0;
> > > > > > > ch2->iir[0].B2=0;
> > > > > > > ch2->iir[0].A1=0;
> > > > > > > ch2->iir[0].A2=0;
> > > > > > >
> > > > > > > ch2->iir[1].B0=1;
> > > > > > > ch2->iir[1].B1=0;
> > > > > > > ch2->iir[1].B2=0;
> > > > > > > ch2->iir[1].A1=0;
> > > > > > > ch2->iir[1].A2=0;
> > > > > > >
> > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > // disable the limits (first save how they were set)
> > > > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > > ch2->LimitSwitchOptions = 0;
> > > > > > >
> > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > >
> > > > > > > EnableAxis(0);
> > > > > > > EnableAxis(1);
> > > > > > > EnableAxis(2);
> > > > > > >
> > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(2,0); // stop
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > DisableAxis(2); // disable the axis
> > > > > > > Zero(2); // Zero the position
> > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home X next - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(0,0); // stop
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > DisableAxis(0); // disable the axis
> > > > > > > Zero(0); // Zero the position
> > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home Y next - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > Jog(1,0); // stop
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > DisableAxis(1); // disable the axis
> > > > > > > Zero(1); // Zero the position
> > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > >
> > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > }
> > > > > > >
> > > > > > > Thanks for all your help
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Let's see:ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  1mm /ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the limit.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  All this information is packed into a 32bit hexadecimal
> LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi TK
> > > > > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > > > > What is the max I can run?(I'm a speed demon)
> > > > > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > > > > Thanks again
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > That's good progress.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one already?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing to see if it works.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Regards
> > > > > > > > > TK
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Date: Monday, June 20, 2011, 4:08 AM


(Message over 64 KB, truncated)
Group: DynoMotion Message: 1404 From: jonny1bar Date: 7/2/2011
Subject: Re: Newbe needs help
Hi Tom,

That works fine now thanks Tom.
Now i have been playing with the limit settings.
In Kmotion config limit switch options i ticked watch limit stop when low bit 3 disallow drive into limit, tried mach 3 jogged the axis tapped the switch and movment stopped but mach3 needs to be reset can it not just stop so you can jog away from the switch ? also how do you setup the soft limits.

Thanks

John



--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> ok great.  That is correct.  You need to now change the program so it only does the axis it is told to do by Mach3.
>  
> Open the HomeMach3 example.
>  
> Copy and paste the code that homes your x axis into the place marked: 
>  
> // do X homing here. 
>  
> Same for Y and Z
>  
> Regards
> TK
>
> --- On Tue, 6/28/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Tuesday, June 28, 2011, 10:25 AM
>
>
>  
>
>
>
> Hi Tom,
>
> The home works fine when i run the c program, I understand what you mean about mach3 it seems to call the cprogram 3 times, is this because my home c program has all the home commands on one page?
> Im sure you will come up with a solution.
> we can move on to the limit issue when we sort the homing one thing at a time.
>
> Thanks
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > Sorry about that. I sent a response last Saturday and I see it in my "sent" folder but somehow it wasn't posted.
> >  
> > here it is again...
> >  
> >  
> >  
> > Hi John,
> >  
> > Sorry I don't really understand your description.  It *should* stop homing when the switch is activated correct?   But it should not stop because of a limit fault.  Regardless of how limits are configured we are disabling limits while homing so I don't understand that comment either.
> >  
> > Let's just get Homing C program to work correctly first before trying to use Mach3.  As I described previously, Mach3 calls your Home.c program multiple times (once for each axis) so we need to add stuff to the C Program so it only homes the axis that Mach3 is requesting to be homed rather than all of them.
> >  
> > Unconnected and unused Inputs will float to random values.  This is normal.
> >  
> > Regards
> > TK
> >
> > --- On Mon, 6/27/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Monday, June 27, 2011, 3:07 PM
> >
> >
> >  
> >
> >
> >
> > Hi Tom
> > Did you get a chance to look at my request
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > >
> > > Hi Tom
> > > That worked perfectly thanks, I have a few more questions.
> > > When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> > > Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> > > Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
> > >
> > > Thanks again
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > >  
> > > >  
> > > > Hi John,
> > > >  
> > > > The C language statement
> > > >  
> > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > >
> > > > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> > > >  
> > > > The " ! " is the NOT operator.  So remove the ! character for a home switch of the opposite polarity.
> > > >  
> > > >  
> > > > Regarding the A Axis disabled.  There was a statement to declare X,Y,Z are used A unused:
> > > >  
> > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > >
> > > > I removed this statement from your Home Program because it should be in your Init program already.  Is it?  Do you have an Init program?
> > > >  
> > > > Regards
> > > > TK
> > > >  
> > > >
> > > > --- On Sat, 6/25/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Saturday, June 25, 2011, 6:50 AM
> > > >
> > > >
> > > >  
> > > >
> > > >
> > > >
> > > > Hi Tom,
> > > >
> > > > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > > > What is the best way to sort this.
> > > > Could we set the loop until IO bit goes high to low somehow.
> > > > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
> > > >
> > > > Thanks
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > > >
> > > > > Hi Tom
> > > > >
> > > > > Ok I will try to work it out
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'‚ 
> > > > > > See Attached
> > > > > > ÃÆ'‚ 
> > > > > > Software is very expensive :}
> > > > > > ÃÆ'‚ 
> > > > > > TK
> > > > > >
> > > > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Friday, June 24, 2011, 1:17 PM
> > > > > >
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi Tom
> > > > > >
> > > > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > > > I am new to all this and need all the help I can get.
> > > > > > I know of people that can help me but not sure how much it will cost.
> > > > > > Thanks
> > > > > >
> > > > > > John
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > The error is because you have a line of code to restore the Limit Switch Options but you neverÃÆ'Æ'‚ÃÆ'‚ saved the options and a location to save them was never declared.ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Are you using the same switch for homing and a limit?ÃÆ'Æ'‚ÃÆ'‚  If you are then you need to:
> > > > > > >
> > > > > > > #1ÃÆ'Æ'‚ÃÆ'‚ declare a place to save the original settings
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚  Add an integer variable (inside the main function just after the bracket) with
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚  int SaveZLimits;
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > #2 save them before homing
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚  SaveZLimits = ch2->LimitSwitchOptions; //ÃÆ'Æ'‚ÃÆ'‚ save original limit settings
> > > > > > >
> > > > > > > #3 disable the limits
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ch2->LimitSwitchOptions = 0;ÃÆ'Æ'‚ÃÆ'‚  // disable limits
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > #4 restore them (after homing)
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Regards
> > > > > > > TK
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Tom,
> > > > > > >
> > > > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > > > If it works can i try it through mach3.
> > > > > > > I have just worked out you can run the program from the c screen.
> > > > > > > Were so close I can taste it.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > #include "KMotionDef.h"
> > > > > > >
> > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > // then they are re-enabled
> > > > > > >
> > > > > > > main()
> > > > > > > {
> > > > > > >
> > > > > > >
> > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > >
> > > > > > > EnableAxis(0);
> > > > > > > EnableAxis(1);
> > > > > > > EnableAxis(2);
> > > > > > >
> > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(2,0); // stop
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > DisableAxis(2); // disable the axis
> > > > > > > Zero(2); // Zero the position
> > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home X next - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(0,0); // stop
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > DisableAxis(0); // disable the axis
> > > > > > > Zero(0); // Zero the position
> > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home Y next - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > Jog(1,0); // stop
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > DisableAxis(1); // disable the axis
> > > > > > > Zero(1); // Zero the position
> > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > >
> > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > }
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > The code looks reasonable to me.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > For Mach3 each axis is homed separately.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  See if that works.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Regards,
> > > > > > > > TK
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Tom,
> > > > > > > >
> > > > > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > > > >
> > > > > > > > Can you also have a quick look at axis C code
> > > > > > > >
> > > > > > > > #include "KMotionDef.h"
> > > > > > > >
> > > > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > > > // enables them
> > > > > > > > // sets them as an xyz coordinate system for GCode
> > > > > > > >
> > > > > > > > int main()
> > > > > > > > {
> > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch0->Vel=40000;
> > > > > > > > ch0->Accel=400000;
> > > > > > > > ch0->Jerk=4000000;
> > > > > > > > ch0->P=0;
> > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > ch0->D=0;
> > > > > > > > ch0->FFAccel=0;
> > > > > > > > ch0->FFVel=0;
> > > > > > > > ch0->MaxI=200;
> > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > ch0->MaxOutput=200;
> > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > ch0->InputChan0=2;
> > > > > > > > ch0->InputChan1=0;
> > > > > > > > ch0->OutputChan0=2;
> > > > > > > > ch0->OutputChan1=0;
> > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > ch0->InputGain0=1;
> > > > > > > > ch0->InputGain1=1;
> > > > > > > > ch0->InputOffset0=0;
> > > > > > > > ch0->InputOffset1=0;
> > > > > > > > ch0->OutputGain=1;
> > > > > > > > ch0->OutputOffset=0;
> > > > > > > > ch0->SlaveGain=1;
> > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > ch0->BacklashRate=0;
> > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > ch0->Lead=0;
> > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > ch0->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > ch0->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > > EnableAxisDest(0,0);
> > > > > > > >
> > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch1->Vel=40000;
> > > > > > > > ch1->Accel=400000;
> > > > > > > > ch1->Jerk=4000000;
> > > > > > > > ch1->P=0;
> > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > ch1->D=0;
> > > > > > > > ch1->FFAccel=0;
> > > > > > > > ch1->FFVel=0;
> > > > > > > > ch1->MaxI=200;
> > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > ch1->MaxOutput=200;
> > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > ch1->InputChan0=2;
> > > > > > > > ch1->InputChan1=0;
> > > > > > > > ch1->OutputChan0=2;
> > > > > > > > ch1->OutputChan1=0;
> > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > ch1->InputGain0=1;
> > > > > > > > ch1->InputGain1=1;
> > > > > > > > ch1->InputOffset0=0;
> > > > > > > > ch1->InputOffset1=0;
> > > > > > > > ch1->OutputGain=1;
> > > > > > > > ch1->OutputOffset=0;
> > > > > > > > ch1->SlaveGain=1;
> > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > ch1->BacklashRate=0;
> > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > ch1->Lead=0;
> > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > ch1->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > ch1->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > > EnableAxisDest(1,0);
> > > > > > > >
> > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch2->Vel=40000;
> > > > > > > > ch2->Accel=400000;
> > > > > > > > ch2->Jerk=4000000;
> > > > > > > > ch2->P=0;
> > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > ch2->D=0;
> > > > > > > > ch2->FFAccel=0;
> > > > > > > > ch2->FFVel=0;
> > > > > > > > ch2->MaxI=200;
> > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > ch2->MaxOutput=200;
> > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > ch2->InputChan0=0;
> > > > > > > > ch2->InputChan1=0;
> > > > > > > > ch2->OutputChan0=0;
> > > > > > > > ch2->OutputChan1=0;
> > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > ch2->InputGain0=1;
> > > > > > > > ch2->InputGain1=1;
> > > > > > > > ch2->InputOffset0=0;
> > > > > > > > ch2->InputOffset1=0;
> > > > > > > > ch2->OutputGain=1;
> > > > > > > > ch2->OutputOffset=0;
> > > > > > > > ch2->SlaveGain=1;
> > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > ch2->BacklashRate=0;
> > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > ch2->Lead=0;
> > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > ch2->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > ch2->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > > EnableAxisDest(2,0);
> > > > > > > >
> > > > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > > > >
> > > > > > > > return 0;
> > > > > > > > }
> > > > > > > >
> > > > > > > > And this is the one for the home switches.
> > > > > > > >
> > > > > > > > #include "KMotionDef.h"
> > > > > > > >
> > > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > > // then they are re-enabled
> > > > > > > >
> > > > > > > > main()
> > > > > > > > {
> > > > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > > > >
> > > > > > > > DisableAxis(0); // Disable all axes
> > > > > > > > DisableAxis(1);
> > > > > > > > DisableAxis(2);
> > > > > > > >
> > > > > > > > // Set the axis parameters here
> > > > > > > > // after everything is configured in the KMotion Screens
> > > > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > > > // then paste here. Repeat for each axis
> > > > > > > >
> > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch0->Vel=40000;
> > > > > > > > ch0->Accel=400000;
> > > > > > > > ch0->Jerk=4000000;
> > > > > > > > ch0->P=0;
> > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > ch0->D=0;
> > > > > > > > ch0->FFAccel=0;
> > > > > > > > ch0->FFVel=0;
> > > > > > > > ch0->MaxI=200;
> > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > ch0->MaxOutput=200;
> > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > ch0->InputChan0=2;
> > > > > > > > ch0->InputChan1=0;
> > > > > > > > ch0->OutputChan0=2;
> > > > > > > > ch0->OutputChan1=0;
> > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > ch0->InputGain0=1;
> > > > > > > > ch0->InputGain1=1;
> > > > > > > > ch0->InputOffset0=0;
> > > > > > > > ch0->InputOffset1=0;
> > > > > > > > ch0->OutputGain=1;
> > > > > > > > ch0->OutputOffset=0;
> > > > > > > > ch0->SlaveGain=1;
> > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > ch0->BacklashRate=0;
> > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > ch0->Lead=0;
> > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > ch0->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > ch0->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > >
> > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch1->Vel=40000;
> > > > > > > > ch1->Accel=400000;
> > > > > > > > ch1->Jerk=4000000;
> > > > > > > > ch1->P=0;
> > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > ch1->D=0;
> > > > > > > > ch1->FFAccel=0;
> > > > > > > > ch1->FFVel=0;
> > > > > > > > ch1->MaxI=200;
> > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > ch1->MaxOutput=200;
> > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > ch1->InputChan0=2;
> > > > > > > > ch1->InputChan1=0;
> > > > > > > > ch1->OutputChan0=2;
> > > > > > > > ch1->OutputChan1=0;
> > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > ch1->InputGain0=1;
> > > > > > > > ch1->InputGain1=1;
> > > > > > > > ch1->InputOffset0=0;
> > > > > > > > ch1->InputOffset1=0;
> > > > > > > > ch1->OutputGain=1;
> > > > > > > > ch1->OutputOffset=0;
> > > > > > > > ch1->SlaveGain=1;
> > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > ch1->BacklashRate=0;
> > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > ch1->Lead=0;
> > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > ch1->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > ch1->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > >
> > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch2->Vel=40000;
> > > > > > > > ch2->Accel=400000;
> > > > > > > > ch2->Jerk=4000000;
> > > > > > > > ch2->P=0;
> > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > ch2->D=0;
> > > > > > > > ch2->FFAccel=0;
> > > > > > > > ch2->FFVel=0;
> > > > > > > > ch2->MaxI=200;
> > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > ch2->MaxOutput=200;
> > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > ch2->InputChan0=0;
> > > > > > > > ch2->InputChan1=0;
> > > > > > > > ch2->OutputChan0=0;
> > > > > > > > ch2->OutputChan1=0;
> > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > ch2->InputGain0=1;
> > > > > > > > ch2->InputGain1=1;
> > > > > > > > ch2->InputOffset0=0;
> > > > > > > > ch2->InputOffset1=0;
> > > > > > > > ch2->OutputGain=1;
> > > > > > > > ch2->OutputOffset=0;
> > > > > > > > ch2->SlaveGain=1;
> > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > ch2->BacklashRate=0;
> > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > ch2->Lead=0;
> > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > ch2->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > ch2->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > // disable the limits (first save how they were set)
> > > > > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > > > ch2->LimitSwitchOptions = 0;
> > > > > > > >
> > > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > > >
> > > > > > > > EnableAxis(0);
> > > > > > > > EnableAxis(1);
> > > > > > > > EnableAxis(2);
> > > > > > > >
> > > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > Jog(2,0); // stop
> > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > DisableAxis(2); // disable the axis
> > > > > > > > Zero(2); // Zero the position
> > > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > >
> > > > > > > > // Home X next - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > Jog(0,0); // stop
> > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > DisableAxis(0); // disable the axis
> > > > > > > > Zero(0); // Zero the position
> > > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > > >
> > > > > > > > // Home Y next - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > > Jog(1,0); // stop
> > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > DisableAxis(1); // disable the axis
> > > > > > > > Zero(1); // Zero the position
> > > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > > >
> > > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > > }
> > > > > > > >
> > > > > > > > Thanks for all your help
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Let's see:ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  1mm /ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the
> limit.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  All this information is packed into a 32bit hexadecimal
> > LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Regards
> > > > > > > > > TK
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi TK
> > > > > > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > > > > > What is the max I can run?(I'm a speed demon)
> > > > > > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > > > > > Thanks again
> > > > > > > > >
> > > > > > > > > John
> > > > > > > > >
> > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi John,
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > That's good progress.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to upgrade to new versions.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare input.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal
> connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one already?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing
> to see if it works.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > Regards
> > > > > > > > > > TK
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > Date: Monday, June 20, 2011, 4:08 AM
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi TK,
> > > > > > > > > >
> > > > > > > > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > > > > > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > > > > > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > > > > > > > Next question is the limit switches.
> > > > > > > > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > > > > > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > > > > > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > > > > > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > > > > > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > > > > > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > > > > > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > > > > > > > >
> > > > > > > > > > Thanks for your help we are getting there.
> > > > > > > > > >
> > > > > > > > > > John
> > > > > > > > > >
> > > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hi John,
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > Did you read the links I sent?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Mach3 link shows step-by-step on how to create the C program using the C Code-> Clip board
> button.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The button doesn't do anything
> > directly.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  It just creates the C code into the Windows Clip Board so you can then paste it into a C
> > > > program.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You might tell a bit about your background so we know where to start.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > If you go to the C Programs Screen and open the file InitStepDir3Axis.c that is basically the C Program you are trying to create.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Read though that file and see if you can identify the
> parts that set all the parameters for Axis channel 0, 1, and 2 and enables those axes and also defines the Coordinate system to be used for GCode.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > From the Console Window if an axis is already configured and enabled, then you can command it to move using a command like MoveRel0=1000 (Relative move of axis0 of 1000 steps).
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > Regards
> > > > > > > > > > > TK
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --- On Sun, 6/19/11, jonny1bar <john@> wrote:
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > > Date: Sunday, June 19, 2011, 11:50 AM
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Hi TK,
> > > > > > > > > > >
> > > > > > > > > > > Thanks for thr quick reply,
> > > > > > > > > > > I pressed the download channel button, I also pressed the c-code clipboard button tried kmotion cnc but nothing. I think i will need some more step by step help I have only setup mach3 before on my router very simple.
> > > > > > > > > > > Can you tell me some code to type into the console screen I believe this is a vay to move the motor,
> > > > > > > > > > > Thanks for your quick response.
> > > > > > > > > > >
> > > > > > > > > > > John
> > > > > > > > > > >
> > > > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Hi John,
> > > > > > > > > > > >
> ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚ 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚¦ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'
> Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > > After you get your motors working within KMotion.exe and the Step Response Screen the next step is to create a C Program to initialize KFLOP with the same settings so that the KMotion
> >
> ProgramÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚ 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚¦ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚ÂÂ
> ¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ is no longer needed to configure and enable your axes.
> > > > > > > > > > > >
> ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚ 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚¦ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'
> Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > > Also before using KMotionCNC or Mach3 the GCode Variables
> X,Y,Z,AÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚ 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚¦ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚ÂÂ
> ¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  need to be mapped to specific KFLOP axis channel numbers using a C
> >
> LanguageÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'â€<br/><br/>(Message over 64 KB, truncated)
Group: DynoMotion Message: 1407 From: Tom Kerekes Date: 7/2/2011
Subject: Re: Newbe needs help
Hi John,
 
Sorry hitting a limit requires a Mach3 Reset.  I don't know of any other way to "stop" Mach3 from executing and such and I don't know how one would to resume after hitting a limit (unless you were just jogging as you describe).  I'm open to suggestions here.  Is the issue having all the positions reset to zero when re-initializing?  There are possible ways around that, especially if you have encoders.  We don't have soft limits implemented.
 
Regards
TK

--- On Sat, 7/2/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Saturday, July 2, 2011, 11:00 AM

 
Hi Tom,

That works fine now thanks Tom.
Now i have been playing with the limit settings.
In Kmotion config limit switch options i ticked watch limit stop when low bit 3 disallow drive into limit, tried mach 3 jogged the axis tapped the switch and movment stopped but mach3 needs to be reset can it not just stop so you can jog away from the switch ? also how do you setup the soft limits.

Thanks

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> ok great.  That is correct.  You need to now change the program so it only does the axis it is told to do by Mach3.
>  
> Open the HomeMach3 example.
>  
> Copy and paste the code that homes your x axis into the place marked: 
>  
> // do X homing here. 
>  
> Same for Y and Z
>  
> Regards
> TK
>
> --- On Tue, 6/28/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Tuesday, June 28, 2011, 10:25 AM
>
>
>  
>
>
>
> Hi Tom,
>
> The home works fine when i run the c program, I understand what you mean about mach3 it seems to call the cprogram 3 times, is this because my home c program has all the home commands on one page?
> Im sure you will come up with a solution.
> we can move on to the limit issue when we sort the homing one thing at a time.
>
> Thanks
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > Sorry about that. I sent a response last Saturday and I see it in my "sent" folder but somehow it wasn't posted.
> >  
> > here it is again...
> >  
> >  
> >  
> > Hi John,
> >  
> > Sorry I don't really understand your description.  It *should* stop homing when the switch is activated correct?   But it should not stop because of a limit fault.  Regardless of how limits are configured we are disabling limits while homing so I don't understand that comment either.
> >  
> > Let's just get Homing C program to work correctly first before trying to use Mach3.  As I described previously, Mach3 calls your Home.c program multiple times (once for each axis) so we need to add stuff to the C Program so it only homes the axis that Mach3 is requesting to be homed rather than all of them.
> >  
> > Unconnected and unused Inputs will float to random values.  This is normal.
> >  
> > Regards
> > TK
> >
> > --- On Mon, 6/27/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Monday, June 27, 2011, 3:07 PM
> >
> >
> >  
> >
> >
> >
> > Hi Tom
> > Did you get a chance to look at my request
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > >
> > > Hi Tom
> > > That worked perfectly thanks, I have a few more questions.
> > > When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> > > Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> > > Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
> > >
> > > Thanks again
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > >  
> > > >  
> > > > Hi John,
> > > >  
> > > > The C language statement
> > > >  
> > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > >
> > > > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> > > >  
> > > > The " ! " is the NOT operator.  So remove the ! character for a home switch of the opposite polarity.
> > > >  
> > > >  
> > > > Regarding the A Axis disabled.  There was a statement to declare X,Y,Z are used A unused:
> > > >  
> > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > >
> > > > I removed this statement from your Home Program because it should be in your Init program already.  Is it?  Do you have an Init program?
> > > >  
> > > > Regards
> > > > TK
> > > >  
> > > >
> > > > --- On Sat, 6/25/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Saturday, June 25, 2011, 6:50 AM
> > > >
> > > >
> > > >  
> > > >
> > > >
> > > >
> > > > Hi Tom,
> > > >
> > > > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > > > What is the best way to sort this.
> > > > Could we set the loop until IO bit goes high to low somehow.
> > > > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
> > > >
> > > > Thanks
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > > >
> > > > > Hi Tom
> > > > >
> > > > > Ok I will try to work it out
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi John,
> > > > > > ÃÆ'‚ 
> > > > > > See Attached
> > > > > > ÃÆ'‚ 
> > > > > > Software is very expensive :}
> > > > > > ÃÆ'‚ 
> > > > > > TK
> > > > > >
> > > > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Friday, June 24, 2011, 1:17 PM
> > > > > >
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi Tom
> > > > > >
> > > > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > > > I am new to all this and need all the help I can get.
> > > > > > I know of people that can help me but not sure how much it will cost.
> > > > > > Thanks
> > > > > >
> > > > > > John
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > The error is because you have a line of code to restore the Limit Switch Options but you neverÃÆ'Æ'‚ÃÆ'‚ saved the options and a location to save them was never declared.ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Are you using the same switch for homing and a limit?ÃÆ'Æ'‚ÃÆ'‚  If you are then you need to:
> > > > > > >
> > > > > > > #1ÃÆ'Æ'‚ÃÆ'‚ declare a place to save the original settings
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚  Add an integer variable (inside the main function just after the bracket) with
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚  int SaveZLimits;
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > #2 save them before homing
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚  SaveZLimits = ch2->LimitSwitchOptions; //ÃÆ'Æ'‚ÃÆ'‚ save original limit settings
> > > > > > >
> > > > > > > #3 disable the limits
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ch2->LimitSwitchOptions = 0;ÃÆ'Æ'‚ÃÆ'‚  // disable limits
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > #4 restore them (after homing)
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Regards
> > > > > > > TK
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Tom,
> > > > > > >
> > > > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > > > If it works can i try it through mach3.
> > > > > > > I have just worked out you can run the program from the c screen.
> > > > > > > Were so close I can taste it.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > #include "KMotionDef.h"
> > > > > > >
> > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > // then they are re-enabled
> > > > > > >
> > > > > > > main()
> > > > > > > {
> > > > > > >
> > > > > > >
> > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > >
> > > > > > > EnableAxis(0);
> > > > > > > EnableAxis(1);
> > > > > > > EnableAxis(2);
> > > > > > >
> > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(2,0); // stop
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > DisableAxis(2); // disable the axis
> > > > > > > Zero(2); // Zero the position
> > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home X next - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > Jog(0,0); // stop
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > DisableAxis(0); // disable the axis
> > > > > > > Zero(0); // Zero the position
> > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > >
> > > > > > > // Home Y next - jog until it sees the limit
> > > > > > >
> > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > Jog(1,0); // stop
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > DisableAxis(1); // disable the axis
> > > > > > > Zero(1); // Zero the position
> > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > >
> > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > }
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > The code looks reasonable to me.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > For Mach3 each axis is homed separately.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push the Ref All Home button.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  See if that works.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Regards,
> > > > > > > > TK
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Tom,
> > > > > > > >
> > > > > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > > > >
> > > > > > > > Can you also have a quick look at axis C code
> > > > > > > >
> > > > > > > > #include "KMotionDef.h"
> > > > > > > >
> > > > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > > > // enables them
> > > > > > > > // sets them as an xyz coordinate system for GCode
> > > > > > > >
> > > > > > > > int main()
> > > > > > > > {
> > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch0->Vel=40000;
> > > > > > > > ch0->Accel=400000;
> > > > > > > > ch0->Jerk=4000000;
> > > > > > > > ch0->P=0;
> > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > ch0->D=0;
> > > > > > > > ch0->FFAccel=0;
> > > > > > > > ch0->FFVel=0;
> > > > > > > > ch0->MaxI=200;
> > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > ch0->MaxOutput=200;
> > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > ch0->InputChan0=2;
> > > > > > > > ch0->InputChan1=0;
> > > > > > > > ch0->OutputChan0=2;
> > > > > > > > ch0->OutputChan1=0;
> > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > ch0->InputGain0=1;
> > > > > > > > ch0->InputGain1=1;
> > > > > > > > ch0->InputOffset0=0;
> > > > > > > > ch0->InputOffset1=0;
> > > > > > > > ch0->OutputGain=1;
> > > > > > > > ch0->OutputOffset=0;
> > > > > > > > ch0->SlaveGain=1;
> > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > ch0->BacklashRate=0;
> > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > ch0->Lead=0;
> > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > ch0->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > ch0->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > > EnableAxisDest(0,0);
> > > > > > > >
> > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch1->Vel=40000;
> > > > > > > > ch1->Accel=400000;
> > > > > > > > ch1->Jerk=4000000;
> > > > > > > > ch1->P=0;
> > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > ch1->D=0;
> > > > > > > > ch1->FFAccel=0;
> > > > > > > > ch1->FFVel=0;
> > > > > > > > ch1->MaxI=200;
> > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > ch1->MaxOutput=200;
> > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > ch1->InputChan0=2;
> > > > > > > > ch1->InputChan1=0;
> > > > > > > > ch1->OutputChan0=2;
> > > > > > > > ch1->OutputChan1=0;
> > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > ch1->InputGain0=1;
> > > > > > > > ch1->InputGain1=1;
> > > > > > > > ch1->InputOffset0=0;
> > > > > > > > ch1->InputOffset1=0;
> > > > > > > > ch1->OutputGain=1;
> > > > > > > > ch1->OutputOffset=0;
> > > > > > > > ch1->SlaveGain=1;
> > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > ch1->BacklashRate=0;
> > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > ch1->Lead=0;
> > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > ch1->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > ch1->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > > EnableAxisDest(1,0);
> > > > > > > >
> > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch2->Vel=40000;
> > > > > > > > ch2->Accel=400000;
> > > > > > > > ch2->Jerk=4000000;
> > > > > > > > ch2->P=0;
> > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > ch2->D=0;
> > > > > > > > ch2->FFAccel=0;
> > > > > > > > ch2->FFVel=0;
> > > > > > > > ch2->MaxI=200;
> > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > ch2->MaxOutput=200;
> > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > ch2->InputChan0=0;
> > > > > > > > ch2->InputChan1=0;
> > > > > > > > ch2->OutputChan0=0;
> > > > > > > > ch2->OutputChan1=0;
> > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > ch2->InputGain0=1;
> > > > > > > > ch2->InputGain1=1;
> > > > > > > > ch2->InputOffset0=0;
> > > > > > > > ch2->InputOffset1=0;
> > > > > > > > ch2->OutputGain=1;
> > > > > > > > ch2->OutputOffset=0;
> > > > > > > > ch2->SlaveGain=1;
> > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > ch2->BacklashRate=0;
> > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > ch2->Lead=0;
> > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > ch2->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > ch2->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > > EnableAxisDest(2,0);
> > > > > > > >
> > > > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > > > >
> > > > > > > > return 0;
> > > > > > > > }
> > > > > > > >
> > > > > > > > And this is the one for the home switches.
> > > > > > > >
> > > > > > > > #include "KMotionDef.h"
> > > > > > > >
> > > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > > // then they are re-enabled
> > > > > > > >
> > > > > > > > main()
> > > > > > > > {
> > > > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > > > >
> > > > > > > > DisableAxis(0); // Disable all axes
> > > > > > > > DisableAxis(1);
> > > > > > > > DisableAxis(2);
> > > > > > > >
> > > > > > > > // Set the axis parameters here
> > > > > > > > // after everything is configured in the KMotion Screens
> > > > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > > > // then paste here. Repeat for each axis
> > > > > > > >
> > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch0->Vel=40000;
> > > > > > > > ch0->Accel=400000;
> > > > > > > > ch0->Jerk=4000000;
> > > > > > > > ch0->P=0;
> > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > ch0->D=0;
> > > > > > > > ch0->FFAccel=0;
> > > > > > > > ch0->FFVel=0;
> > > > > > > > ch0->MaxI=200;
> > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > ch0->MaxOutput=200;
> > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > ch0->InputChan0=2;
> > > > > > > > ch0->InputChan1=0;
> > > > > > > > ch0->OutputChan0=2;
> > > > > > > > ch0->OutputChan1=0;
> > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > ch0->InputGain0=1;
> > > > > > > > ch0->InputGain1=1;
> > > > > > > > ch0->InputOffset0=0;
> > > > > > > > ch0->InputOffset1=0;
> > > > > > > > ch0->OutputGain=1;
> > > > > > > > ch0->OutputOffset=0;
> > > > > > > > ch0->SlaveGain=1;
> > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > ch0->BacklashRate=0;
> > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > ch0->Lead=0;
> > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > ch0->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > ch0->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > >
> > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch1->Vel=40000;
> > > > > > > > ch1->Accel=400000;
> > > > > > > > ch1->Jerk=4000000;
> > > > > > > > ch1->P=0;
> > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > ch1->D=0;
> > > > > > > > ch1->FFAccel=0;
> > > > > > > > ch1->FFVel=0;
> > > > > > > > ch1->MaxI=200;
> > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > ch1->MaxOutput=200;
> > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > ch1->InputChan0=2;
> > > > > > > > ch1->InputChan1=0;
> > > > > > > > ch1->OutputChan0=2;
> > > > > > > > ch1->OutputChan1=0;
> > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > ch1->InputGain0=1;
> > > > > > > > ch1->InputGain1=1;
> > > > > > > > ch1->InputOffset0=0;
> > > > > > > > ch1->InputOffset1=0;
> > > > > > > > ch1->OutputGain=1;
> > > > > > > > ch1->OutputOffset=0;
> > > > > > > > ch1->SlaveGain=1;
> > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > ch1->BacklashRate=0;
> > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > ch1->Lead=0;
> > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > ch1->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > ch1->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > >
> > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > ch2->Vel=40000;
> > > > > > > > ch2->Accel=400000;
> > > > > > > > ch2->Jerk=4000000;
> > > > > > > > ch2->P=0;
> > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > ch2->D=0;
> > > > > > > > ch2->FFAccel=0;
> > > > > > > > ch2->FFVel=0;
> > > > > > > > ch2->MaxI=200;
> > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > ch2->MaxOutput=200;
> > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > ch2->InputChan0=0;
> > > > > > > > ch2->InputChan1=0;
> > > > > > > > ch2->OutputChan0=0;
> > > > > > > > ch2->OutputChan1=0;
> > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > ch2->InputGain0=1;
> > > > > > > > ch2->InputGain1=1;
> > > > > > > > ch2->InputOffset0=0;
> > > > > > > > ch2->InputOffset1=0;
> > > > > > > > ch2->OutputGain=1;
> > > > > > > > ch2->OutputOffset=0;
> > > > > > > > ch2->SlaveGain=1;
> > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > ch2->BacklashRate=0;
> > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > ch2->Lead=0;
> > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > >
> > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > ch2->iir[0].A2=0;
> > > > > > > >
> > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > ch2->iir[1].A2=0;
> > > > > > > >
> > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > // disable the limits (first save how they were set)
> > > > > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > > > ch2->LimitSwitchOptions = 0;
> > > > > > > >
> > > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > > >
> > > > > > > > EnableAxis(0);
> > > > > > > > EnableAxis(1);
> > > > > > > > EnableAxis(2);
> > > > > > > >
> > > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > Jog(2,0); // stop
> > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > DisableAxis(2); // disable the axis
> > > > > > > > Zero(2); // Zero the position
> > > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > >
> > > > > > > > // Home X next - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > Jog(0,0); // stop
> > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > DisableAxis(0); // disable the axis
> > > > > > > > Zero(0); // Zero the position
> > > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > > >
> > > > > > > > // Home Y next - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > > Jog(1,0); // stop
> > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > DisableAxis(1); // disable the axis
> > > > > > > > Zero(1); // Zero the position
> > > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > > >
> > > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > > }
> > > > > > > >
> > > > > > > > Thanks for all your help
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Let's see:ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  at 160 steps/mm x 10000mm/minÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  1mm /ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Then test if the input toggles properly using the Digital I/O Screen.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the
> limit.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  All this information is packed into a 32bit hexadecimal
> > LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â�

(Message over 64 KB, truncated)
Group: DynoMotion Message: 1408 From: jonny1bar Date: 7/2/2011
Subject: Re: Newbe needs help
Hi Tom
Thanks, is the best way to add 3 more switches to the opposite end of the limit , home ones?
Yes it would be nice if I was jogging to be able to move away from the switch if it was activated
I don't think the zeroing when reset is a problem I am only testing at the moment when I install it on the machine and test some more I will let you know.
Thanks

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> Sorry hitting a limit requires a Mach3 Reset.  I don't know of any other way to "stop" Mach3 from executing and such and I don't know how one would to resume after hitting a limit (unless you were just jogging as you describe).  I'm open to suggestions here.  Is the issue having all the positions reset to zero when re-initializing?  There are possible ways around that, especially if you have encoders.  We don't have soft limits implemented.
>  
> Regards
> TK
>
> --- On Sat, 7/2/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Saturday, July 2, 2011, 11:00 AM
>
>
>  
>
>
>
> Hi Tom,
>
> That works fine now thanks Tom.
> Now i have been playing with the limit settings.
> In Kmotion config limit switch options i ticked watch limit stop when low bit 3 disallow drive into limit, tried mach 3 jogged the axis tapped the switch and movment stopped but mach3 needs to be reset can it not just stop so you can jog away from the switch ? also how do you setup the soft limits.
>
> Thanks
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > ok great.  That is correct.  You need to now change the program so it only does the axis it is told to do by Mach3.
> >  
> > Open the HomeMach3 example.
> >  
> > Copy and paste the code that homes your x axis into the place marked: 
> >  
> > // do X homing here. 
> >  
> > Same for Y and Z
> >  
> > Regards
> > TK
> >
> > --- On Tue, 6/28/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Tuesday, June 28, 2011, 10:25 AM
> >
> >
> >  
> >
> >
> >
> > Hi Tom,
> >
> > The home works fine when i run the c program, I understand what you mean about mach3 it seems to call the cprogram 3 times, is this because my home c program has all the home commands on one page?
> > Im sure you will come up with a solution.
> > we can move on to the limit issue when we sort the homing one thing at a time.
> >
> > Thanks
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > Sorry about that. I sent a response last Saturday and I see it in my "sent" folder but somehow it wasn't posted.
> > >  
> > > here it is again...
> > >  
> > >  
> > >  
> > > Hi John,
> > >  
> > > Sorry I don't really understand your description.  It *should* stop homing when the switch is activated correct?   But it should not stop because of a limit fault.  Regardless of how limits are configured we are disabling limits while homing so I don't understand that comment either.
> > >  
> > > Let's just get Homing C program to work correctly first before trying to use Mach3.  As I described previously, Mach3 calls your Home.c program multiple times (once for each axis) so we need to add stuff to the C Program so it only homes the axis that Mach3 is requesting to be homed rather than all of them.
> > >  
> > > Unconnected and unused Inputs will float to random values.  This is normal.
> > >  
> > > Regards
> > > TK
> > >
> > > --- On Mon, 6/27/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Monday, June 27, 2011, 3:07 PM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi Tom
> > > Did you get a chance to look at my request
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > >
> > > > Hi Tom
> > > > That worked perfectly thanks, I have a few more questions.
> > > > When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> > > > Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> > > > Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
> > > >
> > > > Thanks again
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > ÃÆ'‚ 
> > > > > ÃÆ'‚ 
> > > > > Hi John,
> > > > > ÃÆ'‚ 
> > > > > The C language statement
> > > > > ÃÆ'‚ 
> > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > >
> > > > > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> > > > > ÃÆ'‚ 
> > > > > The " ! " is the NOT operator.ÃÆ'‚  So remove the ! character for a home switch of the opposite polarity.
> > > > > ÃÆ'‚ 
> > > > > ÃÆ'‚ 
> > > > > Regarding the A Axis disabled.ÃÆ'‚  There was a statement to declare X,Y,Z are used A unused:
> > > > > ÃÆ'‚ 
> > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > >
> > > > > I removed this statement from your Home Program because it should be in your Init program already.ÃÆ'‚  Is it?ÃÆ'‚  Do you have an Init program?
> > > > > ÃÆ'‚ 
> > > > > Regards
> > > > > TK
> > > > > ÃÆ'‚ 
> > > > >
> > > > > --- On Sat, 6/25/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Saturday, June 25, 2011, 6:50 AM
> > > > >
> > > > >
> > > > > ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi Tom,
> > > > >
> > > > > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > > > > What is the best way to sort this.
> > > > > Could we set the loop until IO bit goes high to low somehow.
> > > > > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
> > > > >
> > > > > Thanks
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > > > >
> > > > > > Hi Tom
> > > > > >
> > > > > > Ok I will try to work it out
> > > > > >
> > > > > > John
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > See Attached
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Software is very expensive :}
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > TK
> > > > > > >
> > > > > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Friday, June 24, 2011, 1:17 PM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Tom
> > > > > > >
> > > > > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > > > > I am new to all this and need all the help I can get.
> > > > > > > I know of people that can help me but not sure how much it will cost.
> > > > > > > Thanks
> > > > > > >
> > > > > > > John
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > The error is because you have a line of code to restore the Limit Switch Options but you neverÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ saved the options and a location to save them was never declared.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Are you using the same switch for homing and a limit?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If you are then you need to:
> > > > > > > >
> > > > > > > > #1ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ declare a place to save the original settings
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Add an integer variable (inside the main function just after the bracket) with
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  int SaveZLimits;
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > #2 save them before homing
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  SaveZLimits = ch2->LimitSwitchOptions; //ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ save original limit settings
> > > > > > > >
> > > > > > > > #3 disable the limits
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ch2->LimitSwitchOptions = 0;ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  // disable limits
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > #4 restore them (after homing)
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Tom,
> > > > > > > >
> > > > > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > > > > If it works can i try it through mach3.
> > > > > > > > I have just worked out you can run the program from the c screen.
> > > > > > > > Were so close I can taste it.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > #include "KMotionDef.h"
> > > > > > > >
> > > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > > // then they are re-enabled
> > > > > > > >
> > > > > > > > main()
> > > > > > > > {
> > > > > > > >
> > > > > > > >
> > > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > > >
> > > > > > > > EnableAxis(0);
> > > > > > > > EnableAxis(1);
> > > > > > > > EnableAxis(2);
> > > > > > > >
> > > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > Jog(2,0); // stop
> > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > DisableAxis(2); // disable the axis
> > > > > > > > Zero(2); // Zero the position
> > > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > >
> > > > > > > > // Home X next - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > Jog(0,0); // stop
> > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > DisableAxis(0); // disable the axis
> > > > > > > > Zero(0); // Zero the position
> > > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > > >
> > > > > > > > // Home Y next - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > > Jog(1,0); // stop
> > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > DisableAxis(1); // disable the axis
> > > > > > > > Zero(1); // Zero the position
> > > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > > >
> > > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > > }
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > The code looks reasonable to me.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > For Mach3 each axis is homed separately.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push
> the Ref All Home button.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  See if that works.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Regards,
> > > > > > > > > TK
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi Tom,
> > > > > > > > >
> > > > > > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > > > > >
> > > > > > > > > Can you also have a quick look at axis C code
> > > > > > > > >
> > > > > > > > > #include "KMotionDef.h"
> > > > > > > > >
> > > > > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > > > > // enables them
> > > > > > > > > // sets them as an xyz coordinate system for GCode
> > > > > > > > >
> > > > > > > > > int main()
> > > > > > > > > {
> > > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch0->Vel=40000;
> > > > > > > > > ch0->Accel=400000;
> > > > > > > > > ch0->Jerk=4000000;
> > > > > > > > > ch0->P=0;
> > > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > > ch0->D=0;
> > > > > > > > > ch0->FFAccel=0;
> > > > > > > > > ch0->FFVel=0;
> > > > > > > > > ch0->MaxI=200;
> > > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > > ch0->MaxOutput=200;
> > > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > > ch0->InputChan0=2;
> > > > > > > > > ch0->InputChan1=0;
> > > > > > > > > ch0->OutputChan0=2;
> > > > > > > > > ch0->OutputChan1=0;
> > > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > > ch0->InputGain0=1;
> > > > > > > > > ch0->InputGain1=1;
> > > > > > > > > ch0->InputOffset0=0;
> > > > > > > > > ch0->InputOffset1=0;
> > > > > > > > > ch0->OutputGain=1;
> > > > > > > > > ch0->OutputOffset=0;
> > > > > > > > > ch0->SlaveGain=1;
> > > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > > ch0->BacklashRate=0;
> > > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > > ch0->Lead=0;
> > > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > > ch0->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > > ch0->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > > > EnableAxisDest(0,0);
> > > > > > > > >
> > > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch1->Vel=40000;
> > > > > > > > > ch1->Accel=400000;
> > > > > > > > > ch1->Jerk=4000000;
> > > > > > > > > ch1->P=0;
> > > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > > ch1->D=0;
> > > > > > > > > ch1->FFAccel=0;
> > > > > > > > > ch1->FFVel=0;
> > > > > > > > > ch1->MaxI=200;
> > > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > > ch1->MaxOutput=200;
> > > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > > ch1->InputChan0=2;
> > > > > > > > > ch1->InputChan1=0;
> > > > > > > > > ch1->OutputChan0=2;
> > > > > > > > > ch1->OutputChan1=0;
> > > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > > ch1->InputGain0=1;
> > > > > > > > > ch1->InputGain1=1;
> > > > > > > > > ch1->InputOffset0=0;
> > > > > > > > > ch1->InputOffset1=0;
> > > > > > > > > ch1->OutputGain=1;
> > > > > > > > > ch1->OutputOffset=0;
> > > > > > > > > ch1->SlaveGain=1;
> > > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > > ch1->BacklashRate=0;
> > > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > > ch1->Lead=0;
> > > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > > ch1->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > > ch1->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > > > EnableAxisDest(1,0);
> > > > > > > > >
> > > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch2->Vel=40000;
> > > > > > > > > ch2->Accel=400000;
> > > > > > > > > ch2->Jerk=4000000;
> > > > > > > > > ch2->P=0;
> > > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > > ch2->D=0;
> > > > > > > > > ch2->FFAccel=0;
> > > > > > > > > ch2->FFVel=0;
> > > > > > > > > ch2->MaxI=200;
> > > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > > ch2->MaxOutput=200;
> > > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > > ch2->InputChan0=0;
> > > > > > > > > ch2->InputChan1=0;
> > > > > > > > > ch2->OutputChan0=0;
> > > > > > > > > ch2->OutputChan1=0;
> > > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > > ch2->InputGain0=1;
> > > > > > > > > ch2->InputGain1=1;
> > > > > > > > > ch2->InputOffset0=0;
> > > > > > > > > ch2->InputOffset1=0;
> > > > > > > > > ch2->OutputGain=1;
> > > > > > > > > ch2->OutputOffset=0;
> > > > > > > > > ch2->SlaveGain=1;
> > > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > > ch2->BacklashRate=0;
> > > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > > ch2->Lead=0;
> > > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > > ch2->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > > ch2->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > > > EnableAxisDest(2,0);
> > > > > > > > >
> > > > > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > > > > >
> > > > > > > > > return 0;
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > And this is the one for the home switches.
> > > > > > > > >
> > > > > > > > > #include "KMotionDef.h"
> > > > > > > > >
> > > > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > > > // then they are re-enabled
> > > > > > > > >
> > > > > > > > > main()
> > > > > > > > > {
> > > > > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > > > > >
> > > > > > > > > DisableAxis(0); // Disable all axes
> > > > > > > > > DisableAxis(1);
> > > > > > > > > DisableAxis(2);
> > > > > > > > >
> > > > > > > > > // Set the axis parameters here
> > > > > > > > > // after everything is configured in the KMotion Screens
> > > > > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > > > > // then paste here. Repeat for each axis
> > > > > > > > >
> > > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch0->Vel=40000;
> > > > > > > > > ch0->Accel=400000;
> > > > > > > > > ch0->Jerk=4000000;
> > > > > > > > > ch0->P=0;
> > > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > > ch0->D=0;
> > > > > > > > > ch0->FFAccel=0;
> > > > > > > > > ch0->FFVel=0;
> > > > > > > > > ch0->MaxI=200;
> > > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > > ch0->MaxOutput=200;
> > > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > > ch0->InputChan0=2;
> > > > > > > > > ch0->InputChan1=0;
> > > > > > > > > ch0->OutputChan0=2;
> > > > > > > > > ch0->OutputChan1=0;
> > > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > > ch0->InputGain0=1;
> > > > > > > > > ch0->InputGain1=1;
> > > > > > > > > ch0->InputOffset0=0;
> > > > > > > > > ch0->InputOffset1=0;
> > > > > > > > > ch0->OutputGain=1;
> > > > > > > > > ch0->OutputOffset=0;
> > > > > > > > > ch0->SlaveGain=1;
> > > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > > ch0->BacklashRate=0;
> > > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > > ch0->Lead=0;
> > > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > > ch0->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > > ch0->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > > >
> > > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch1->Vel=40000;
> > > > > > > > > ch1->Accel=400000;
> > > > > > > > > ch1->Jerk=4000000;
> > > > > > > > > ch1->P=0;
> > > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > > ch1->D=0;
> > > > > > > > > ch1->FFAccel=0;
> > > > > > > > > ch1->FFVel=0;
> > > > > > > > > ch1->MaxI=200;
> > > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > > ch1->MaxOutput=200;
> > > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > > ch1->InputChan0=2;
> > > > > > > > > ch1->InputChan1=0;
> > > > > > > > > ch1->OutputChan0=2;
> > > > > > > > > ch1->OutputChan1=0;
> > > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > > ch1->InputGain0=1;
> > > > > > > > > ch1->InputGain1=1;
> > > > > > > > > ch1->InputOffset0=0;
> > > > > > > > > ch1->InputOffset1=0;
> > > > > > > > > ch1->OutputGain=1;
> > > > > > > > > ch1->OutputOffset=0;
> > > > > > > > > ch1->SlaveGain=1;
> > > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > > ch1->BacklashRate=0;
> > > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > > ch1->Lead=0;
> > > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > > ch1->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > > ch1->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > > >
> > > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch2->Vel=40000;
> > > > > > > > > ch2->Accel=400000;
> > > > > > > > > ch2->Jerk=4000000;
> > > > > > > > > ch2->P=0;
> > > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > > ch2->D=0;
> > > > > > > > > ch2->FFAccel=0;
> > > > > > > > > ch2->FFVel=0;
> > > > > > > > > ch2->MaxI=200;
> > > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > > ch2->MaxOutput=200;
> > > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > > ch2->InputChan0=0;
> > > > > > > > > ch2->InputChan1=0;
> > > > > > > > > ch2->OutputChan0=0;
> > > > > > > > > ch2->OutputChan1=0;
> > > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > > ch2->InputGain0=1;
> > > > > > > > > ch2->InputGain1=1;
> > > > > > > > > ch2->InputOffset0=0;
> > > > > > > > > ch2->InputOffset1=0;
> > > > > > > > > ch2->OutputGain=1;
> > > > > > > > > ch2->OutputOffset=0;
> > > > > > > > > ch2->SlaveGain=1;
> > > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > > ch2->BacklashRate=0;
> > > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > > ch2->Lead=0;
> > > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > > ch2->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > > ch2->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > // disable the limits (first save how they were set)
> > > > > > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > > > > ch2->LimitSwitchOptions = 0;
> > > > > > > > >
> > > > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > > > >
> > > > > > > > > EnableAxis(0);
> > > > > > > > > EnableAxis(1);
> > > > > > > > > EnableAxis(2);
> > > > > > > > >
> > > > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > > > >
> > > > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > > Jog(2,0); // stop
> > > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > > DisableAxis(2); // disable the axis
> > > > > > > > > Zero(2); // Zero the position
> > > > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > > >
> > > > > > > > > // Home X next - jog until it sees the limit
> > > > > > > > >
> > > > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > > Jog(0,0); // stop
> > > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > > DisableAxis(0); // disable the axis
> > > > > > > > > Zero(0); // Zero the position
> > > > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > > > >
> > > > > > > > > // Home Y next - jog until it sees the limit
> > > > > > > > >
> > > > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > > > Jog(1,0); // stop
> > > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > > DisableAxis(1); // disable the axis
> > > > > > > > > Zero(1); // Zero the position
> > > > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > > > >
> > > > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > Thanks for all your help
> > > > > > > > >
> > > > > > > > > John
> > > > > > > > >
> > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > >
> > > > > > > > > > Hi John,
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > Let's see:ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  at 160 steps/mm x
> 10000mm/minÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  1mm
> /ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Most Stepper motors have very limited torque beyond that step rate.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > >
> > > > > > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Then test if the input toggles properly using the Digital I/O
> Screen.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash Screen.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the
> > limit.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Use the "Disallow drive into limit" mode.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  All this information is packed into a 32bit hexadecimal
> > > LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > Regards
> > > > > > > > > > TK
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > >
> > > > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi TK
> > > > > > > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > > > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > > > > > > What is the max I can run?(I'm a speed demon)
> > > > > > > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > > > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > > > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > > > > > > Thanks again
> > > > > > > > > >
> > > > > > > > > > John
> > > > > > > > > >
> > > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Hi John,
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > That's good progress.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > Yes if everything is the same for your axes then you can copy all the settings from one axis channel to another by saving them as a *.mot file, then loading the file to the other axis channel and then just adjust the Output Channel as appropriate.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > You can save the Init.c file anywhere you wish but I usually prefer to save it outside the KMotion Install directory.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That keeps your specific files separate and makes it easier to
> upgrade to new versions.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > The indicated Home Inputs are just recommendations.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Home and limits are all performed in software with no special hardware so they may be connected to any spare
> input.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your sensor outputs a +5V signal
> > connect it to one of the 5V tolerant inputs like IO0.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Or put a 100 ohm resistor in series.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > There are 3rd party spindle control boards that can convert a KFLOP digital PWM signal to a 0-10V analog signal.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Maybe you have one
> already?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  There is a C example called PWM1KHz.c that you can do basic testing
> > to see if it works.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > Regards
> > > > > > > > > > > TK
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > > Date: Monday, June 20, 2011, 4:08 AM
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Hi TK,
> > > > > > > > > > >
> > > > > > > > > > > I setup mach3 and kmotion as described. In the plugin I set the initalize user programe to C:\KMotion425\C Programs\InitStepDir3Axis.c and tried to move the axis and it moved, Happy days!
> > > > > > > > > > > I am begining to understand the setup now. I will tune the motors in config and flash screen, Am I correct because all my 3 motors and drivers are the same once I tune one i can use the same step settings with the appropiate channel number for the other axis?
> > > > > > > > > > > Then I paste them all together and save the file in C:\KMotion425\C Programs would be the best place to put it, then I select that in the mach3 kmotion plugin.
> > > > > > > > > > > Next question is the limit switches.
> > > > > > > > > > > First thing is how to wire them In. JP7 I am using pins 15 to 20 for the steppers but it said pin 15 home axis0 or step axis 0 which pins will i use for x y & z home.
> > > > > > > > > > > My home switches are 3 wire proximity switches +5v, gnd & signal.
> > > > > > > > > > > I will also need an output for the spindle on off. I am using a vfd which can be controlled manually or by linking pins 1 and 2 on the vfd this is the way i have it controlled from the spindle relay on my current BOB. Also i have been trying for 2 years now to controll the spindle speed from mach3 but with no joy and several spindle speed controll boards, All the VFD needs is a 0-10v signal to determine the speed.
> > > > > > > > > > > I own a small modelmakeing and prototyping company in Bristol UK.
> > > > > > > > > > > Started with CNC about 7 years ago with a Roland MDX20, than bought 2 2nd hand chinese 6090 size routers from ebay 3 years ago with missing hand dsp unit, so i converted them to mach3, last year bought a large 8 x 4 foot machine from the same person again not working and within 2 hours of getting it home I was cutting.
> > > > > > > > > > > I have always wanted to get encoder feedback and the spindle speed sorted and more speed this is why i bought the Kflop.
> > > > > > > > > > > Reciently I have been getting problems with what I thought was my axis jaming but I removed the lead screws and they were all free. This only happned when I upgraded my version of mach3. I removed one of the motors and jogged the axis and sometimes at a certain point while it was ramping up in speed it would stop and make a horrible noise, some careful motor tuning has made it a lot better but it still happens occasionally this is why I want the Kflop on there hopefully it should be more stable
> > > > > > > > > > >
> > > > > > > > > > > Thanks for your help we are getting there.
> > > > > > > > > > >
> > > > > > > > > > > John
> > > > > > > > > > >
> > > > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Hi John,
> > > > > > > > > > > >
> ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚ 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚¦ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'
> Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > > Did you read the links I
> sent?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚Â<br/><br/>(Message over 64 KB, truncated)
Group: DynoMotion Message: 1409 From: Tom Kerekes Date: 7/2/2011
Subject: Re: Newbe needs help
Yes that is the simplest method.  If you use separate limit inputs for opposite ends and select "Disallow Drive into Limit" then you can re-enable the axes while in the limit and it will remain enabled unless it detects commanded motion in the direction that would be further into the limit. 
 
TK

--- On Sat, 7/2/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Saturday, July 2, 2011, 12:58 PM

 
Hi Tom
Thanks, is the best way to add 3 more switches to the opposite end of the limit , home ones?
Yes it would be nice if I was jogging to be able to move away from the switch if it was activated
I don't think the zeroing when reset is a problem I am only testing at the moment when I install it on the machine and test some more I will let you know.
Thanks

John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi John,
>  
> Sorry hitting a limit requires a Mach3 Reset.  I don't know of any other way to "stop" Mach3 from executing and such and I don't know how one would to resume after hitting a limit (unless you were just jogging as you describe).  I'm open to suggestions here.  Is the issue having all the positions reset to zero when re-initializing?  There are possible ways around that, especially if you have encoders.  We don't have soft limits implemented.
>  
> Regards
> TK
>
> --- On Sat, 7/2/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Saturday, July 2, 2011, 11:00 AM
>
>
>  
>
>
>
> Hi Tom,
>
> That works fine now thanks Tom.
> Now i have been playing with the limit settings.
> In Kmotion config limit switch options i ticked watch limit stop when low bit 3 disallow drive into limit, tried mach 3 jogged the axis tapped the switch and movment stopped but mach3 needs to be reset can it not just stop so you can jog away from the switch ? also how do you setup the soft limits.
>
> Thanks
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > ok great.  That is correct.  You need to now change the program so it only does the axis it is told to do by Mach3.
> >  
> > Open the HomeMach3 example.
> >  
> > Copy and paste the code that homes your x axis into the place marked: 
> >  
> > // do X homing here. 
> >  
> > Same for Y and Z
> >  
> > Regards
> > TK
> >
> > --- On Tue, 6/28/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Tuesday, June 28, 2011, 10:25 AM
> >
> >
> >  
> >
> >
> >
> > Hi Tom,
> >
> > The home works fine when i run the c program, I understand what you mean about mach3 it seems to call the cprogram 3 times, is this because my home c program has all the home commands on one page?
> > Im sure you will come up with a solution.
> > we can move on to the limit issue when we sort the homing one thing at a time.
> >
> > Thanks
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > Sorry about that. I sent a response last Saturday and I see it in my "sent" folder but somehow it wasn't posted.
> > >  
> > > here it is again...
> > >  
> > >  
> > >  
> > > Hi John,
> > >  
> > > Sorry I don't really understand your description.  It *should* stop homing when the switch is activated correct?   But it should not stop because of a limit fault.  Regardless of how limits are configured we are disabling limits while homing so I don't understand that comment either.
> > >  
> > > Let's just get Homing C program to work correctly first before trying to use Mach3.  As I described previously, Mach3 calls your Home.c program multiple times (once for each axis) so we need to add stuff to the C Program so it only homes the axis that Mach3 is requesting to be homed rather than all of them.
> > >  
> > > Unconnected and unused Inputs will float to random values.  This is normal.
> > >  
> > > Regards
> > > TK
> > >
> > > --- On Mon, 6/27/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Monday, June 27, 2011, 3:07 PM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi Tom
> > > Did you get a chance to look at my request
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > >
> > > > Hi Tom
> > > > That worked perfectly thanks, I have a few more questions.
> > > > When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> > > > Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> > > > Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
> > > >
> > > > Thanks again
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > ÃÆ'‚ 
> > > > > ÃÆ'‚ 
> > > > > Hi John,
> > > > > ÃÆ'‚ 
> > > > > The C language statement
> > > > > ÃÆ'‚ 
> > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > >
> > > > > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> > > > > ÃÆ'‚ 
> > > > > The " ! " is the NOT operator.ÃÆ'‚  So remove the ! character for a home switch of the opposite polarity.
> > > > > ÃÆ'‚ 
> > > > > ÃÆ'‚ 
> > > > > Regarding the A Axis disabled.ÃÆ'‚  There was a statement to declare X,Y,Z are used A unused:
> > > > > ÃÆ'‚ 
> > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > >
> > > > > I removed this statement from your Home Program because it should be in your Init program already.ÃÆ'‚  Is it?ÃÆ'‚  Do you have an Init program?
> > > > > ÃÆ'‚ 
> > > > > Regards
> > > > > TK
> > > > > ÃÆ'‚ 
> > > > >
> > > > > --- On Sat, 6/25/11, jonny1bar <john@> wrote:
> > > > >
> > > > >
> > > > > From: jonny1bar <john@>
> > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Date: Saturday, June 25, 2011, 6:50 AM
> > > > >
> > > > >
> > > > > ÃÆ'‚ 
> > > > >
> > > > >
> > > > >
> > > > > Hi Tom,
> > > > >
> > > > > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > > > > What is the best way to sort this.
> > > > > Could we set the loop until IO bit goes high to low somehow.
> > > > > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
> > > > >
> > > > > Thanks
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > > > >
> > > > > > Hi Tom
> > > > > >
> > > > > > Ok I will try to work it out
> > > > > >
> > > > > > John
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi John,
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > See Attached
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Software is very expensive :}
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > TK
> > > > > > >
> > > > > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > > > > >
> > > > > > >
> > > > > > > From: jonny1bar <john@>
> > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Date: Friday, June 24, 2011, 1:17 PM
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Tom
> > > > > > >
> > > > > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > > > > I am new to all this and need all the help I can get.
> > > > > > > I know of people that can help me but not sure how much it will cost.
> > > > > > > Thanks
> > > > > > >
> > > > > > > John
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > The error is because you have a line of code to restore the Limit Switch Options but you neverÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ saved the options and a location to save them was never declared.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Are you using the same switch for homing and a limit?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If you are then you need to:
> > > > > > > >
> > > > > > > > #1ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ declare a place to save the original settings
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Add an integer variable (inside the main function just after the bracket) with
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  int SaveZLimits;
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > #2 save them before homing
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  SaveZLimits = ch2->LimitSwitchOptions; //ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ save original limit settings
> > > > > > > >
> > > > > > > > #3 disable the limits
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ch2->LimitSwitchOptions = 0;ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  // disable limits
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > #4 restore them (after homing)
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Tom,
> > > > > > > >
> > > > > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > > > > If it works can i try it through mach3.
> > > > > > > > I have just worked out you can run the program from the c screen.
> > > > > > > > Were so close I can taste it.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > #include "KMotionDef.h"
> > > > > > > >
> > > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > > // then they are re-enabled
> > > > > > > >
> > > > > > > > main()
> > > > > > > > {
> > > > > > > >
> > > > > > > >
> > > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > > >
> > > > > > > > EnableAxis(0);
> > > > > > > > EnableAxis(1);
> > > > > > > > EnableAxis(2);
> > > > > > > >
> > > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > Jog(2,0); // stop
> > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > DisableAxis(2); // disable the axis
> > > > > > > > Zero(2); // Zero the position
> > > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > >
> > > > > > > > // Home X next - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > Jog(0,0); // stop
> > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > DisableAxis(0); // disable the axis
> > > > > > > > Zero(0); // Zero the position
> > > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > > >
> > > > > > > > // Home Y next - jog until it sees the limit
> > > > > > > >
> > > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > > Jog(1,0); // stop
> > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > DisableAxis(1); // disable the axis
> > > > > > > > Zero(1); // Zero the position
> > > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > > >
> > > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > > }
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > The code looks reasonable to me.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > For Mach3 each axis is homed separately.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push
> the Ref All Home button.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  See if that works.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Regards,
> > > > > > > > > TK
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi Tom,
> > > > > > > > >
> > > > > > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > > > > >
> > > > > > > > > Can you also have a quick look at axis C code
> > > > > > > > >
> > > > > > > > > #include "KMotionDef.h"
> > > > > > > > >
> > > > > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > > > > // enables them
> > > > > > > > > // sets them as an xyz coordinate system for GCode
> > > > > > > > >
> > > > > > > > > int main()
> > > > > > > > > {
> > > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch0->Vel=40000;
> > > > > > > > > ch0->Accel=400000;
> > > > > > > > > ch0->Jerk=4000000;
> > > > > > > > > ch0->P=0;
> > > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > > ch0->D=0;
> > > > > > > > > ch0->FFAccel=0;
> > > > > > > > > ch0->FFVel=0;
> > > > > > > > > ch0->MaxI=200;
> > > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > > ch0->MaxOutput=200;
> > > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > > ch0->InputChan0=2;
> > > > > > > > > ch0->InputChan1=0;
> > > > > > > > > ch0->OutputChan0=2;
> > > > > > > > > ch0->OutputChan1=0;
> > > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > > ch0->InputGain0=1;
> > > > > > > > > ch0->InputGain1=1;
> > > > > > > > > ch0->InputOffset0=0;
> > > > > > > > > ch0->InputOffset1=0;
> > > > > > > > > ch0->OutputGain=1;
> > > > > > > > > ch0->OutputOffset=0;
> > > > > > > > > ch0->SlaveGain=1;
> > > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > > ch0->BacklashRate=0;
> > > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > > ch0->Lead=0;
> > > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > > ch0->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > > ch0->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > > > EnableAxisDest(0,0);
> > > > > > > > >
> > > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch1->Vel=40000;
> > > > > > > > > ch1->Accel=400000;
> > > > > > > > > ch1->Jerk=4000000;
> > > > > > > > > ch1->P=0;
> > > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > > ch1->D=0;
> > > > > > > > > ch1->FFAccel=0;
> > > > > > > > > ch1->FFVel=0;
> > > > > > > > > ch1->MaxI=200;
> > > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > > ch1->MaxOutput=200;
> > > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > > ch1->InputChan0=2;
> > > > > > > > > ch1->InputChan1=0;
> > > > > > > > > ch1->OutputChan0=2;
> > > > > > > > > ch1->OutputChan1=0;
> > > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > > ch1->InputGain0=1;
> > > > > > > > > ch1->InputGain1=1;
> > > > > > > > > ch1->InputOffset0=0;
> > > > > > > > > ch1->InputOffset1=0;
> > > > > > > > > ch1->OutputGain=1;
> > > > > > > > > ch1->OutputOffset=0;
> > > > > > > > > ch1->SlaveGain=1;
> > > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > > ch1->BacklashRate=0;
> > > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > > ch1->Lead=0;
> > > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > > ch1->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > > ch1->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > > > EnableAxisDest(1,0);
> > > > > > > > >
> > > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch2->Vel=40000;
> > > > > > > > > ch2->Accel=400000;
> > > > > > > > > ch2->Jerk=4000000;
> > > > > > > > > ch2->P=0;
> > > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > > ch2->D=0;
> > > > > > > > > ch2->FFAccel=0;
> > > > > > > > > ch2->FFVel=0;
> > > > > > > > > ch2->MaxI=200;
> > > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > > ch2->MaxOutput=200;
> > > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > > ch2->InputChan0=0;
> > > > > > > > > ch2->InputChan1=0;
> > > > > > > > > ch2->OutputChan0=0;
> > > > > > > > > ch2->OutputChan1=0;
> > > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > > ch2->InputGain0=1;
> > > > > > > > > ch2->InputGain1=1;
> > > > > > > > > ch2->InputOffset0=0;
> > > > > > > > > ch2->InputOffset1=0;
> > > > > > > > > ch2->OutputGain=1;
> > > > > > > > > ch2->OutputOffset=0;
> > > > > > > > > ch2->SlaveGain=1;
> > > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > > ch2->BacklashRate=0;
> > > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > > ch2->Lead=0;
> > > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > > ch2->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > > ch2->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > > > EnableAxisDest(2,0);
> > > > > > > > >
> > > > > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > > > > >
> > > > > > > > > return 0;
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > And this is the one for the home switches.
> > > > > > > > >
> > > > > > > > > #include "KMotionDef.h"
> > > > > > > > >
> > > > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > > > // then they are re-enabled
> > > > > > > > >
> > > > > > > > > main()
> > > > > > > > > {
> > > > > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > > > > >
> > > > > > > > > DisableAxis(0); // Disable all axes
> > > > > > > > > DisableAxis(1);
> > > > > > > > > DisableAxis(2);
> > > > > > > > >
> > > > > > > > > // Set the axis parameters here
> > > > > > > > > // after everything is configured in the KMotion Screens
> > > > > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > > > > // then paste here. Repeat for each axis
> > > > > > > > >
> > > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch0->Vel=40000;
> > > > > > > > > ch0->Accel=400000;
> > > > > > > > > ch0->Jerk=4000000;
> > > > > > > > > ch0->P=0;
> > > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > > ch0->D=0;
> > > > > > > > > ch0->FFAccel=0;
> > > > > > > > > ch0->FFVel=0;
> > > > > > > > > ch0->MaxI=200;
> > > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > > ch0->MaxOutput=200;
> > > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > > ch0->InputChan0=2;
> > > > > > > > > ch0->InputChan1=0;
> > > > > > > > > ch0->OutputChan0=2;
> > > > > > > > > ch0->OutputChan1=0;
> > > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > > ch0->InputGain0=1;
> > > > > > > > > ch0->InputGain1=1;
> > > > > > > > > ch0->InputOffset0=0;
> > > > > > > > > ch0->InputOffset1=0;
> > > > > > > > > ch0->OutputGain=1;
> > > > > > > > > ch0->OutputOffset=0;
> > > > > > > > > ch0->SlaveGain=1;
> > > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > > ch0->BacklashRate=0;
> > > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > > ch0->Lead=0;
> > > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > > ch0->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > > ch0->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > > >
> > > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch1->Vel=40000;
> > > > > > > > > ch1->Accel=400000;
> > > > > > > > > ch1->Jerk=4000000;
> > > > > > > > > ch1->P=0;
> > > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > > ch1->D=0;
> > > > > > > > > ch1->FFAccel=0;
> > > > > > > > > ch1->FFVel=0;
> > > > > > > > > ch1->MaxI=200;
> > > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > > ch1->MaxOutput=200;
> > > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > > ch1->InputChan0=2;
> > > > > > > > > ch1->InputChan1=0;
> > > > > > > > > ch1->OutputChan0=2;
> > > > > > > > > ch1->OutputChan1=0;
> > > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > > ch1->InputGain0=1;
> > > > > > > > > ch1->InputGain1=1;
> > > > > > > > > ch1->InputOffset0=0;
> > > > > > > > > ch1->InputOffset1=0;
> > > > > > > > > ch1->OutputGain=1;
> > > > > > > > > ch1->OutputOffset=0;
> > > > > > > > > ch1->SlaveGain=1;
> > > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > > ch1->BacklashRate=0;
> > > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > > ch1->Lead=0;
> > > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > > ch1->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > > ch1->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > > >
> > > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > > ch2->Vel=40000;
> > > > > > > > > ch2->Accel=400000;
> > > > > > > > > ch2->Jerk=4000000;
> > > > > > > > > ch2->P=0;
> > > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > > ch2->D=0;
> > > > > > > > > ch2->FFAccel=0;
> > > > > > > > > ch2->FFVel=0;
> > > > > > > > > ch2->MaxI=200;
> > > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > > ch2->MaxOutput=200;
> > > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > > ch2->InputChan0=0;
> > > > > > > > > ch2->InputChan1=0;
> > > > > > > > > ch2->OutputChan0=0;
> > > > > > > > > ch2->OutputChan1=0;
> > > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > > ch2->InputGain0=1;
> > > > > > > > > ch2->InputGain1=1;
> > > > > > > > > ch2->InputOffset0=0;
> > > > > > > > > ch2->InputOffset1=0;
> > > > > > > > > ch2->OutputGain=1;
> > > > > > > > > ch2->OutputOffset=0;
> > > > > > > > > ch2->SlaveGain=1;
> > > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > > ch2->BacklashRate=0;
> > > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > > ch2->Lead=0;
> > > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > > >
> > > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > > ch2->iir[0].A2=0;
> > > > > > > > >
> > > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > > ch2->iir[1].A2=0;
> > > > > > > > >
> > > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > // disable the limits (first save how they were set)
> > > > > > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > > > > ch2->LimitSwitchOptions = 0;
> > > > > > > > >
> > > > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > > > >
> > > > > > > > > EnableAxis(0);
> > > > > > > > > EnableAxis(1);
> > > > > > > > > EnableAxis(2);
> > > > > > > > >
> > > > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > > > >
> > > > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > > Jog(2,0); // stop
> > > >

(Message over 64 KB, truncated)
Group: DynoMotion Message: 1410 From: jonny1bar Date: 7/2/2011
Subject: Re: Newbe needs help
Thanks Tom how do you enable the axis without pressing the reset button?
John

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Yes that is the simplest method.  If you use separate limit inputs for opposite ends and select "Disallow Drive into Limit" then you can re-enable the axes while in the limit and it will remain enabled unless it detects commanded motion in the direction that would be further into the limit. 
>  
> TK
>
> --- On Sat, 7/2/11, jonny1bar <john@...> wrote:
>
>
> From: jonny1bar <john@...>
> Subject: [DynoMotion] Re: Newbe needs help
> To: DynoMotion@yahoogroups.com
> Date: Saturday, July 2, 2011, 12:58 PM
>
>
>  
>
>
>
> Hi Tom
> Thanks, is the best way to add 3 more switches to the opposite end of the limit , home ones?
> Yes it would be nice if I was jogging to be able to move away from the switch if it was activated
> I don't think the zeroing when reset is a problem I am only testing at the moment when I install it on the machine and test some more I will let you know.
> Thanks
>
> John
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi John,
> >  
> > Sorry hitting a limit requires a Mach3 Reset.  I don't know of any other way to "stop" Mach3 from executing and such and I don't know how one would to resume after hitting a limit (unless you were just jogging as you describe).  I'm open to suggestions here.  Is the issue having all the positions reset to zero when re-initializing?  There are possible ways around that, especially if you have encoders.  We don't have soft limits implemented.
> >  
> > Regards
> > TK
> >
> > --- On Sat, 7/2/11, jonny1bar <john@> wrote:
> >
> >
> > From: jonny1bar <john@>
> > Subject: [DynoMotion] Re: Newbe needs help
> > To: DynoMotion@yahoogroups.com
> > Date: Saturday, July 2, 2011, 11:00 AM
> >
> >
> >  
> >
> >
> >
> > Hi Tom,
> >
> > That works fine now thanks Tom.
> > Now i have been playing with the limit settings.
> > In Kmotion config limit switch options i ticked watch limit stop when low bit 3 disallow drive into limit, tried mach 3 jogged the axis tapped the switch and movment stopped but mach3 needs to be reset can it not just stop so you can jog away from the switch ? also how do you setup the soft limits.
> >
> > Thanks
> >
> > John
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi John,
> > >  
> > > ok great.  That is correct.  You need to now change the program so it only does the axis it is told to do by Mach3.
> > >  
> > > Open the HomeMach3 example.
> > >  
> > > Copy and paste the code that homes your x axis into the place marked: 
> > >  
> > > // do X homing here. 
> > >  
> > > Same for Y and Z
> > >  
> > > Regards
> > > TK
> > >
> > > --- On Tue, 6/28/11, jonny1bar <john@> wrote:
> > >
> > >
> > > From: jonny1bar <john@>
> > > Subject: [DynoMotion] Re: Newbe needs help
> > > To: DynoMotion@yahoogroups.com
> > > Date: Tuesday, June 28, 2011, 10:25 AM
> > >
> > >
> > >  
> > >
> > >
> > >
> > > Hi Tom,
> > >
> > > The home works fine when i run the c program, I understand what you mean about mach3 it seems to call the cprogram 3 times, is this because my home c program has all the home commands on one page?
> > > Im sure you will come up with a solution.
> > > we can move on to the limit issue when we sort the homing one thing at a time.
> > >
> > > Thanks
> > >
> > > John
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi John,
> > > > ÃÆ'‚ 
> > > > Sorry about that. I sent a response last Saturday and I see it in my "sent" folder but somehow it wasn't posted.
> > > > ÃÆ'‚ 
> > > > here it is again...
> > > > ÃÆ'‚ 
> > > > ÃÆ'‚ 
> > > > ÃÆ'‚ 
> > > > Hi John,
> > > > ÃÆ'‚ 
> > > > Sorry I don't really understand your description.ÃÆ'‚  It *should* stop homing when the switch is activated correct?ÃÆ'‚ ÃÆ'‚  But it should not stop because of a limit fault.ÃÆ'‚  Regardless of how limits are configured we are disabling limits while homing so I don't understand that comment either.
> > > > ÃÆ'‚ 
> > > > Let's just get Homing C program to work correctly first before trying to use Mach3.ÃÆ'‚  As IÃÆ'‚ described previously, Mach3 calls your Home.c program multiple times (once for each axis) so we need to add stuff to the C Program so it only homesÃÆ'‚ the axis that Mach3 is requesting to be homed rather than all of them.
> > > > ÃÆ'‚ 
> > > > Unconnected and unused Inputs will float to random values.ÃÆ'‚  This is normal.
> > > > ÃÆ'‚ 
> > > > Regards
> > > > TK
> > > >
> > > > --- On Mon, 6/27/11, jonny1bar <john@> wrote:
> > > >
> > > >
> > > > From: jonny1bar <john@>
> > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > To: DynoMotion@yahoogroups.com
> > > > Date: Monday, June 27, 2011, 3:07 PM
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > >
> > > >
> > > >
> > > > Hi Tom
> > > > Did you get a chance to look at my request
> > > >
> > > > John
> > > >
> > > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > > >
> > > > > Hi Tom
> > > > > That worked perfectly thanks, I have a few more questions.
> > > > > When I activate the limit switches in kmotion, watch limit, limit low, io, etc and run the home c program it stops when I tap the switch.
> > > > > Next when I deactivate the limit so everything works in kmotion and home in mach3 it seems to home twice, I press home, motor moves slowly I tap the switch it moves reverse direction the preset Amount then moves slowly again and if you tap the switch it reverses direction the preset amount and stops.
> > > > > Last thing the io screen there are a lot of flashing lights apart from the ones that are assigned.
> > > > >
> > > > > Thanks again
> > > > >
> > > > > John
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Hi John,
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > The C language statement
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > >
> > > > > > translated to English would be: loop doing nothing while a read of bit 10 is not true.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > The " ! " is the NOT operator.ÃÆ'Æ'‚ÃÆ'‚  So remove the ! character for a home switch of the opposite polarity.
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Regarding the A Axis disabled.ÃÆ'Æ'‚ÃÆ'‚  There was a statement to declare X,Y,Z are used A unused:
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > >
> > > > > > I removed this statement from your Home Program because it should be in your Init program already.ÃÆ'Æ'‚ÃÆ'‚  Is it?ÃÆ'Æ'‚ÃÆ'‚  Do you have an Init program?
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > Regards
> > > > > > TK
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > > --- On Sat, 6/25/11, jonny1bar <john@> wrote:
> > > > > >
> > > > > >
> > > > > > From: jonny1bar <john@>
> > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Date: Saturday, June 25, 2011, 6:50 AM
> > > > > >
> > > > > >
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hi Tom,
> > > > > >
> > > > > > Everything works fine when i run the programes in the c code screen apart from my limit switches are always high until activated,
> > > > > > What is the best way to sort this.
> > > > > > Could we set the loop until IO bit goes high to low somehow.
> > > > > > Also when I am in mach3 now it flags up dynomotion status: A Axis dissabled wont let me do anything, any ideas.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > John
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, "jonny1bar" <john@> wrote:
> > > > > > >
> > > > > > > Hi Tom
> > > > > > >
> > > > > > > Ok I will try to work it out
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi John,
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > See Attached
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Software is very expensive :}
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > TK
> > > > > > > >
> > > > > > > > --- On Fri, 6/24/11, jonny1bar <john@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: jonny1bar <john@>
> > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Date: Friday, June 24, 2011, 1:17 PM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Tom
> > > > > > > >
> > > > > > > > Yes I use 1 switch for homeing and limit on each axis.
> > > > > > > > Could you compile a c program for me to get the limit switches working so I can see what you have done.
> > > > > > > > I am new to all this and need all the help I can get.
> > > > > > > > I know of people that can help me but not sure how much it will cost.
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > John
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > > Hi John,
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > The error is because you have a line of code to restore the Limit Switch Options but you neverÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ saved the options and a location to save them was never declared.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Are you using the same switch for homing and a limit?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If you are then you need to:
> > > > > > > > >
> > > > > > > > > #1ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ declare a place to save the original settings
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Add an integer variable (inside the main function just after the bracket) with
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  int SaveZLimits;
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > #2 save them before homing
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  SaveZLimits = ch2->LimitSwitchOptions; //ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ save original limit settings
> > > > > > > > >
> > > > > > > > > #3 disable the limits
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ch2->LimitSwitchOptions = 0;ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  // disable limits
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > #4 restore them (after homing)
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > If you are using a separate input then you can leave the limits enabled while homing so then just delete the restore.
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Regards
> > > > > > > > > TK
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- On Thu, 6/23/11, jonny1bar <john@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Date: Thursday, June 23, 2011, 10:43 AM
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi Tom,
> > > > > > > > >
> > > > > > > > > Is this what you ment i tried to compile but there was an error can you have a look and clean it up a bit for me.
> > > > > > > > > If it works can i try it through mach3.
> > > > > > > > > I have just worked out you can run the program from the c screen.
> > > > > > > > > Were so close I can taste it.
> > > > > > > > >
> > > > > > > > > Thanks
> > > > > > > > >
> > > > > > > > > John
> > > > > > > > >
> > > > > > > > > #include "KMotionDef.h"
> > > > > > > > >
> > > > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > > > // then they are re-enabled
> > > > > > > > >
> > > > > > > > > main()
> > > > > > > > > {
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > > > >
> > > > > > > > > EnableAxis(0);
> > > > > > > > > EnableAxis(1);
> > > > > > > > > EnableAxis(2);
> > > > > > > > >
> > > > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > > > >
> > > > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > > Jog(2,0); // stop
> > > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > > DisableAxis(2); // disable the axis
> > > > > > > > > Zero(2); // Zero the position
> > > > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > > >
> > > > > > > > > // Home X next - jog until it sees the limit
> > > > > > > > >
> > > > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > > Jog(0,0); // stop
> > > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > > DisableAxis(0); // disable the axis
> > > > > > > > > Zero(0); // Zero the position
> > > > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > > > >
> > > > > > > > > // Home Y next - jog until it sees the limit
> > > > > > > > >
> > > > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > > > Jog(1,0); // stop
> > > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > > DisableAxis(1); // disable the axis
> > > > > > > > > Zero(1); // Zero the position
> > > > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > > > >
> > > > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > >
> > > > > > > > > > Hi John,
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > The code looks reasonable to me.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But it isn't normally necessary to include all the configuration settings in the Home program as this is normally set int the Init program when the system is Reset.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > For Mach3 each axis is homed separately.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The Ref All Home button homes all the axes by calling the home program multiple times each time passing a "flags" variable which instructs which axis is to be homed.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> Your program is not checking the variable and homing all the axis, so that might be part of the confusion.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If your homing routine was working I would expect all the axes to home several times if you push
> > the Ref All Home button.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > But before worrying about Mach3 and testing the flags variable it is better to leave it as you have it and just run it once from the C Programs Screen to debug it.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > To figure out what is happening to debug it, remove or comment out everything except the first step of homing the z axis.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Which is the Jog, wait for switch, stop.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  See if that works.
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > Regards,
> > > > > > > > > > TK
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --- On Wed, 6/22/11, jonny1bar <john@> wrote:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > Date: Wednesday, June 22, 2011, 11:05 AM
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi Tom,
> > > > > > > > > >
> > > > > > > > > > I have managed to link up a limit switch for testing on z axis, Z homes first thought it made sense. Set it up in kmotion and mach3,in mach3 diagnostic screen when switch is pressed M3 home comes on, When i press ref all home the motor spins 180 degres one way then 180 the other way before i get a chance to do anything with the limit switch, any ideas.
> > > > > > > > > > When you jog the axis and then press the limit switch the axis stops as it should.
> > > > > > > > > > Can you help me with motor step response settings I havent got a clue what i am doing.
> > > > > > > > > >
> > > > > > > > > > Can you also have a quick look at axis C code
> > > > > > > > > >
> > > > > > > > > > #include "KMotionDef.h"
> > > > > > > > > >
> > > > > > > > > > // Defines axis 0, 1, 2 as simple step dir outputs
> > > > > > > > > > // enables them
> > > > > > > > > > // sets them as an xyz coordinate system for GCode
> > > > > > > > > >
> > > > > > > > > > int main()
> > > > > > > > > > {
> > > > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > > > ch0->Vel=40000;
> > > > > > > > > > ch0->Accel=400000;
> > > > > > > > > > ch0->Jerk=4000000;
> > > > > > > > > > ch0->P=0;
> > > > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > > > ch0->D=0;
> > > > > > > > > > ch0->FFAccel=0;
> > > > > > > > > > ch0->FFVel=0;
> > > > > > > > > > ch0->MaxI=200;
> > > > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > > > ch0->MaxOutput=200;
> > > > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > > > ch0->InputChan0=2;
> > > > > > > > > > ch0->InputChan1=0;
> > > > > > > > > > ch0->OutputChan0=2;
> > > > > > > > > > ch0->OutputChan1=0;
> > > > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > > > ch0->InputGain0=1;
> > > > > > > > > > ch0->InputGain1=1;
> > > > > > > > > > ch0->InputOffset0=0;
> > > > > > > > > > ch0->InputOffset1=0;
> > > > > > > > > > ch0->OutputGain=1;
> > > > > > > > > > ch0->OutputOffset=0;
> > > > > > > > > > ch0->SlaveGain=1;
> > > > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > > > ch0->BacklashRate=0;
> > > > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > > > ch0->Lead=0;
> > > > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > > > >
> > > > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > > > ch0->iir[0].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > > > ch0->iir[1].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > > > > EnableAxisDest(0,0);
> > > > > > > > > >
> > > > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > > > ch1->Vel=40000;
> > > > > > > > > > ch1->Accel=400000;
> > > > > > > > > > ch1->Jerk=4000000;
> > > > > > > > > > ch1->P=0;
> > > > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > > > ch1->D=0;
> > > > > > > > > > ch1->FFAccel=0;
> > > > > > > > > > ch1->FFVel=0;
> > > > > > > > > > ch1->MaxI=200;
> > > > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > > > ch1->MaxOutput=200;
> > > > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > > > ch1->InputChan0=2;
> > > > > > > > > > ch1->InputChan1=0;
> > > > > > > > > > ch1->OutputChan0=2;
> > > > > > > > > > ch1->OutputChan1=0;
> > > > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > > > ch1->InputGain0=1;
> > > > > > > > > > ch1->InputGain1=1;
> > > > > > > > > > ch1->InputOffset0=0;
> > > > > > > > > > ch1->InputOffset1=0;
> > > > > > > > > > ch1->OutputGain=1;
> > > > > > > > > > ch1->OutputOffset=0;
> > > > > > > > > > ch1->SlaveGain=1;
> > > > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > > > ch1->BacklashRate=0;
> > > > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > > > ch1->Lead=0;
> > > > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > > > >
> > > > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > > > ch1->iir[0].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > > > ch1->iir[1].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > > > > EnableAxisDest(1,0);
> > > > > > > > > >
> > > > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > > > ch2->Vel=40000;
> > > > > > > > > > ch2->Accel=400000;
> > > > > > > > > > ch2->Jerk=4000000;
> > > > > > > > > > ch2->P=0;
> > > > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > > > ch2->D=0;
> > > > > > > > > > ch2->FFAccel=0;
> > > > > > > > > > ch2->FFVel=0;
> > > > > > > > > > ch2->MaxI=200;
> > > > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > > > ch2->MaxOutput=200;
> > > > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > > > ch2->InputChan0=0;
> > > > > > > > > > ch2->InputChan1=0;
> > > > > > > > > > ch2->OutputChan0=0;
> > > > > > > > > > ch2->OutputChan1=0;
> > > > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > > > ch2->InputGain0=1;
> > > > > > > > > > ch2->InputGain1=1;
> > > > > > > > > > ch2->InputOffset0=0;
> > > > > > > > > > ch2->InputOffset1=0;
> > > > > > > > > > ch2->OutputGain=1;
> > > > > > > > > > ch2->OutputOffset=0;
> > > > > > > > > > ch2->SlaveGain=1;
> > > > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > > > ch2->BacklashRate=0;
> > > > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > > > ch2->Lead=0;
> > > > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > > > >
> > > > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > > > ch2->iir[0].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > > > ch2->iir[1].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > > > > EnableAxisDest(2,0);
> > > > > > > > > >
> > > > > > > > > > DefineCoordSystem(0,1,2,-1);
> > > > > > > > > >
> > > > > > > > > > return 0;
> > > > > > > > > > }
> > > > > > > > > >
> > > > > > > > > > And this is the one for the home switches.
> > > > > > > > > >
> > > > > > > > > > #include "KMotionDef.h"
> > > > > > > > > >
> > > > > > > > > > // Configuration and Homing program for a 3 axis System
> > > > > > > > > > // Limit switches are disabled and used as a home switch
> > > > > > > > > > // then they are re-enabled
> > > > > > > > > >
> > > > > > > > > > main()
> > > > > > > > > > {
> > > > > > > > > > int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
> > > > > > > > > >
> > > > > > > > > > DisableAxis(0); // Disable all axes
> > > > > > > > > > DisableAxis(1);
> > > > > > > > > > DisableAxis(2);
> > > > > > > > > >
> > > > > > > > > > // Set the axis parameters here
> > > > > > > > > > // after everything is configured in the KMotion Screens
> > > > > > > > > > // use copy C Code to clipboard on the configuration screen
> > > > > > > > > > // then paste here. Repeat for each axis
> > > > > > > > > >
> > > > > > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > > > > > ch0->Vel=40000;
> > > > > > > > > > ch0->Accel=400000;
> > > > > > > > > > ch0->Jerk=4000000;
> > > > > > > > > > ch0->P=0;
> > > > > > > > > > ch0->I=0.009999999776483;
> > > > > > > > > > ch0->D=0;
> > > > > > > > > > ch0->FFAccel=0;
> > > > > > > > > > ch0->FFVel=0;
> > > > > > > > > > ch0->MaxI=200;
> > > > > > > > > > ch0->MaxErr=1000000;
> > > > > > > > > > ch0->MaxOutput=200;
> > > > > > > > > > ch0->DeadBandGain=1;
> > > > > > > > > > ch0->DeadBandRange=0;
> > > > > > > > > > ch0->InputChan0=2;
> > > > > > > > > > ch0->InputChan1=0;
> > > > > > > > > > ch0->OutputChan0=2;
> > > > > > > > > > ch0->OutputChan1=0;
> > > > > > > > > > ch0->MasterAxis=-1;
> > > > > > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > > > > > ch0->InputGain0=1;
> > > > > > > > > > ch0->InputGain1=1;
> > > > > > > > > > ch0->InputOffset0=0;
> > > > > > > > > > ch0->InputOffset1=0;
> > > > > > > > > > ch0->OutputGain=1;
> > > > > > > > > > ch0->OutputOffset=0;
> > > > > > > > > > ch0->SlaveGain=1;
> > > > > > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > > > > > ch0->BacklashAmount=0;
> > > > > > > > > > ch0->BacklashRate=0;
> > > > > > > > > > ch0->invDistPerCycle=1;
> > > > > > > > > > ch0->Lead=0;
> > > > > > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > > > > > ch0->StepperAmplitude=20;
> > > > > > > > > >
> > > > > > > > > > ch0->iir[0].B0=1;
> > > > > > > > > > ch0->iir[0].B1=0;
> > > > > > > > > > ch0->iir[0].B2=0;
> > > > > > > > > > ch0->iir[0].A1=0;
> > > > > > > > > > ch0->iir[0].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch0->iir[1].B0=1;
> > > > > > > > > > ch0->iir[1].B1=0;
> > > > > > > > > > ch0->iir[1].B2=0;
> > > > > > > > > > ch0->iir[1].A1=0;
> > > > > > > > > > ch0->iir[1].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch0->iir[2].B0=0.0007689999765716;
> > > > > > > > > > ch0->iir[2].B1=0.001537999953143;
> > > > > > > > > > ch0->iir[2].B2=0.0007689999765716;
> > > > > > > > > > ch0->iir[2].A1=1.920809984207;
> > > > > > > > > > ch0->iir[2].A2=-0.9238849878311;
> > > > > > > > > >
> > > > > > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > > > > > ch1->Vel=40000;
> > > > > > > > > > ch1->Accel=400000;
> > > > > > > > > > ch1->Jerk=4000000;
> > > > > > > > > > ch1->P=0;
> > > > > > > > > > ch1->I=0.009999999776483;
> > > > > > > > > > ch1->D=0;
> > > > > > > > > > ch1->FFAccel=0;
> > > > > > > > > > ch1->FFVel=0;
> > > > > > > > > > ch1->MaxI=200;
> > > > > > > > > > ch1->MaxErr=1000000;
> > > > > > > > > > ch1->MaxOutput=200;
> > > > > > > > > > ch1->DeadBandGain=1;
> > > > > > > > > > ch1->DeadBandRange=0;
> > > > > > > > > > ch1->InputChan0=2;
> > > > > > > > > > ch1->InputChan1=0;
> > > > > > > > > > ch1->OutputChan0=2;
> > > > > > > > > > ch1->OutputChan1=0;
> > > > > > > > > > ch1->MasterAxis=-1;
> > > > > > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > > > > > ch1->InputGain0=1;
> > > > > > > > > > ch1->InputGain1=1;
> > > > > > > > > > ch1->InputOffset0=0;
> > > > > > > > > > ch1->InputOffset1=0;
> > > > > > > > > > ch1->OutputGain=1;
> > > > > > > > > > ch1->OutputOffset=0;
> > > > > > > > > > ch1->SlaveGain=1;
> > > > > > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > > > > > ch1->BacklashAmount=0;
> > > > > > > > > > ch1->BacklashRate=0;
> > > > > > > > > > ch1->invDistPerCycle=1;
> > > > > > > > > > ch1->Lead=0;
> > > > > > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > > > > > ch1->StepperAmplitude=20;
> > > > > > > > > >
> > > > > > > > > > ch1->iir[0].B0=1;
> > > > > > > > > > ch1->iir[0].B1=0;
> > > > > > > > > > ch1->iir[0].B2=0;
> > > > > > > > > > ch1->iir[0].A1=0;
> > > > > > > > > > ch1->iir[0].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch1->iir[1].B0=1;
> > > > > > > > > > ch1->iir[1].B1=0;
> > > > > > > > > > ch1->iir[1].B2=0;
> > > > > > > > > > ch1->iir[1].A1=0;
> > > > > > > > > > ch1->iir[1].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch1->iir[2].B0=0.0007689999765716;
> > > > > > > > > > ch1->iir[2].B1=0.001537999953143;
> > > > > > > > > > ch1->iir[2].B2=0.0007689999765716;
> > > > > > > > > > ch1->iir[2].A1=1.920809984207;
> > > > > > > > > > ch1->iir[2].A2=-0.9238849878311;
> > > > > > > > > >
> > > > > > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > > > > > ch2->Vel=40000;
> > > > > > > > > > ch2->Accel=400000;
> > > > > > > > > > ch2->Jerk=4000000;
> > > > > > > > > > ch2->P=0;
> > > > > > > > > > ch2->I=0.009999999776483;
> > > > > > > > > > ch2->D=0;
> > > > > > > > > > ch2->FFAccel=0;
> > > > > > > > > > ch2->FFVel=0;
> > > > > > > > > > ch2->MaxI=200;
> > > > > > > > > > ch2->MaxErr=1000000;
> > > > > > > > > > ch2->MaxOutput=200;
> > > > > > > > > > ch2->DeadBandGain=1;
> > > > > > > > > > ch2->DeadBandRange=0;
> > > > > > > > > > ch2->InputChan0=0;
> > > > > > > > > > ch2->InputChan1=0;
> > > > > > > > > > ch2->OutputChan0=0;
> > > > > > > > > > ch2->OutputChan1=0;
> > > > > > > > > > ch2->MasterAxis=-1;
> > > > > > > > > > ch2->LimitSwitchOptions=0x30015;
> > > > > > > > > > ch2->InputGain0=1;
> > > > > > > > > > ch2->InputGain1=1;
> > > > > > > > > > ch2->InputOffset0=0;
> > > > > > > > > > ch2->InputOffset1=0;
> > > > > > > > > > ch2->OutputGain=1;
> > > > > > > > > > ch2->OutputOffset=0;
> > > > > > > > > > ch2->SlaveGain=1;
> > > > > > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > > > > > ch2->BacklashAmount=0;
> > > > > > > > > > ch2->BacklashRate=0;
> > > > > > > > > > ch2->invDistPerCycle=1;
> > > > > > > > > > ch2->Lead=0;
> > > > > > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > > > > > ch2->StepperAmplitude=20;
> > > > > > > > > >
> > > > > > > > > > ch2->iir[0].B0=1;
> > > > > > > > > > ch2->iir[0].B1=0;
> > > > > > > > > > ch2->iir[0].B2=0;
> > > > > > > > > > ch2->iir[0].A1=0;
> > > > > > > > > > ch2->iir[0].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch2->iir[1].B0=1;
> > > > > > > > > > ch2->iir[1].B1=0;
> > > > > > > > > > ch2->iir[1].B2=0;
> > > > > > > > > > ch2->iir[1].A1=0;
> > > > > > > > > > ch2->iir[1].A2=0;
> > > > > > > > > >
> > > > > > > > > > ch2->iir[2].B0=0.0007689999765716;
> > > > > > > > > > ch2->iir[2].B1=0.001537999953143;
> > > > > > > > > > ch2->iir[2].B2=0.0007689999765716;
> > > > > > > > > > ch2->iir[2].A1=1.920809984207;
> > > > > > > > > > ch2->iir[2].A2=-0.9238849878311;
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > // disable the limits (first save how they were set)
> > > > > > > > > > SaveXLimits = ch0->LimitSwitchOptions;
> > > > > > > > > > SaveYLimits = ch1->LimitSwitchOptions;
> > > > > > > > > > SaveZLimits = ch2->LimitSwitchOptions;
> > > > > > > > > > ch0->LimitSwitchOptions = 0;
> > > > > > > > > > ch1->LimitSwitchOptions = 0;
> > > > > > > > > > ch2->LimitSwitchOptions = 0;
> > > > > > > > > >
> > > > > > > > > > // enable all 3 axes and begin servoing where we are
> > > > > > > > > >
> > > > > > > > > > EnableAxis(0);
> > > > > > > > > > EnableAxis(1);
> > > > > > > > > > EnableAxis(2);
> > > > > > > > > >
> > > > > > > > > > // Home Z up first - jog until it sees the limit
> > > > > > > > > >
> > > > > > > > > > Jog(2,100); // jog slowly positive
> > > > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > > > Jog(2,0); // stop
> > > > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > > > DisableAxis(2); // disable the axis
> > > > > > > > > > Zero(2); // Zero the position
> > > > > > > > > > EnableAxis(2); // re-enable the ServoTick
> > > > > > > > > > Move(2,-1000.0); // move some amount inside the limits
> > > > > > > > > > while (!CheckDone(2)) ; // loop until motion completes
> > > > > > > > > > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > > > > > > > > >
> > > > > > > > > > // Home X next - jog until it sees the limit
> > > > > > > > > >
> > > > > > > > > > Jog(0,-100); // jog slowly negative
> > > > > > > > > > while (!ReadBit(10)) ; // loop until IO bit goes high
> > > > > > > > > > Jog(0,0); // stop
> > > > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > > > DisableAxis(0); // disable the axis
> > > > > > > > > > Zero(0); // Zero the position
> > > > > > > > > > EnableAxis(0); // re-enable the ServoTick
> > > > > > > > > > Move(0,1000.0); // move some amount inside the limits
> > > > > > > > > > while (!CheckDone(0)) ; // loop until motion completes
> > > > > > > > > > ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
> > > > > > > > > >
> > > > > > > > > > // Home Y next - jog until it sees the limit
> > > > > > > > > >
> > > > > > > > > > Jog(1,-100); // jog slowly negative
> > > > > > > > > > while (!ReadBit(9)) ; // loop until IO bit goes high
> > > > > > > > > > Jog(1,0); // stop
> > > > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > > > DisableAxis(1); // disable the axis
> > > > > > > > > > Zero(1); // Zero the position
> > > > > > > > > > EnableAxis(1); // re-enable the ServoTick
> > > > > > > > > > Move(1,1000.0); // move some amount inside the limits
> > > > > > > > > > while (!CheckDone(1)) ; // loop until motion completes
> > > > > > > > > > ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
> > > > > > > > > >
> > > > > > > > > > DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
> > > > > > > > > > }
> > > > > > > > > >
> > > > > > > > > > Thanks for all your help
> > > > > > > > > >
> > > > > > > > > > John
> > > > > > > > > >
> > > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hi John,
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > Let's see:ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  at 160 steps/mm x
> >
> 10000mm/minÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ xÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚ÂÂ
> ¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  1mm
> > /ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 60sec = 26,666 steps/sec
> > > > > > > > > > > KFLOP can pulse at 2.5MHz so that won't be your limitation.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > I assume your drivers have 8 usteps/full step so the stepper speed would be 3333 full steps per second.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Most Stepper motors have very limited torque beyond that step
> rate.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > >
> > > > > > > > > > > All the hard real time IO like Step/Dir and Limit switches are configured within KFLOP not Mach3.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > The first step for limits is to connect the inputs to KFLOP taking care to not connect any signal that is driven above 3.8V to any 3.3V only input without a series resistor.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Then test if
> the input toggles properly using the Digital I/O
> > Screen.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If so, then configure the Limit Settings on the Config/Flash
> Screen.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Set the corresponding input bits and polarities and select that KFLOP should watch the
> > > limit.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Use the "Disallow drive into limit"
> mode.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  All this information is packed into a 32bit hexadecimal
> > > > LimitSwitchOptions value as described in KMotionDef.h but you don't need to understand that as it is performed automatically when the Settings are converted to C Code.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > No sorry SnapAmp doesn't have any 0-10V analog outputs.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But yes it can drive steppers, brushless, or brush motors.
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > > Regards
> > > > > > > > > > > TK
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > >
> > > > > > > > > > > --- On Mon, 6/20/11, jonny1bar <john@> wrote:
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > From: jonny1bar <john@>
> > > > > > > > > > > Subject: [DynoMotion] Re: Newbe needs help
> > > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > > Date: Monday, June 20, 2011, 2:13 PM
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â¦ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Hi TK
> > > > > > > > > > > I'm getting excited I tuned the motor in Mach3 and moved it at 10m per minute silky smooth.
> > > > > > > > > > > Settings are 10mm pitch ball screws 1600 steps per rev stepper drivers = 160 steps per rev in Mach 3 so at 10m per minute motor is 1000rpm am I correct ?
> > > > > > > > > > > What is the max I can run?(I'm a speed demon)
> > > > > > > > > > > Can you give me a bit more info on the limit switches I 40% understand, can you tell me the basic settings in Mach 3 and kmotion and what to do.
> > > > > > > > > > > Also in mach3 in the ports and pins all I have done is activate xy&z axis is this all I have to do.
> > > > > > > > > > > I have been looking at your snap amp is this a servo and stepper driver can this also supply a 0-10v signal for the vfd.
> > > > > > > > > > > Thanks again
> > > > > > > > > > >
> > > > > > > > > > > John
> > > > > > > > > > >
> > > > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Hi John,
> > > > > > > > > > > >
> ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚ 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¬ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'‚¦ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Â 'ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'‚ÃÆ'‚¢ÃÆ'
> Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬Ã<br/><br/>(Message over 64 KB, truncated)
Group: DynoMotion Message: 1411 From: Tom Kerekes Date: 7/2/2011
Subject: Re: Newbe needs help
Well normally you would use the Reset button to call the Init.c program to re-enable the axes so I'm not quite sure why you ask.  But anything that executes an EnableAxis in KFlop would enable the axis.
 
TK

--- On Sat, 7/2/11, jonny1bar <john@...> wrote:

From: jonny1bar <john@...>
Subject: [DynoMotion] Re: Newbe needs help
To: DynoMotion@yahoogroups.com
Date: Saturday, July 2, 2011, 3:27 PM

 
Thanks Tom how do you enable the axis without pressing the reset button?
John
 
.